Question: MATLAB online Example: for loops The script below calculates N! i.e. the factorial of an integer N. In this example N=5. Background: N! = N(N

MATLAB online Example: for loops The script below calculates N! i.e. thefactorial of an integer N. In this example N=5. Background: N! =MATLAB online

Example: for loops The script below calculates N! i.e. the factorial of an integer N. In this example N=5. Background: N! = N(N 1)(N 2). (N (N 1)) 5! = 5x4x3x2x1 ; Note 0! = 1 N= 5; F=1; % a dummy variable F set to an initial value of 1. for i=1:N; F=i*E; _% Each time the loop cycles it updates F to F times i, end display(F) 4 Remote Lab Assignment for the Week of March 30th MATLAB Exercises t = 180 So, you can change N=3 to calculate 3! or set N=101 to get 101., etc. Of course, MATLAB already has a factorial function. Give it try by typing into the command window factorial(5). Task: 3) Write a script that utilizes a for loop" and creates an array of the form M = [3,9, 27,81]. (10pts) 4) The exponential function can be calculated using the following series: ex = 1 + x + + 6 + 2 n! Write a script that utilizes a for loop to calculate e 0.3 to the 10th term (i.e. n=9) in the series. (10pts)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!