Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started