Question: NUMERICAL METHODS-MATLAB (a) Type a script m-file that calculates e2 by the Maclaurin series using a while loop. x x1 x2 x3 The while loop
NUMERICAL METHODS-MATLAB

(a) Type a script m-file that calculates e2 by the Maclaurin series using a while loop. x x1 x2 x3 The while loop should increase the number of polynomial when the absolute error is smaller than 0.01, abs defined below. The error is the exact value minus the approximate value. Is per iteration. The program should exit the loop absolute error lexact - approxl Be sure to use fprintfwithin the loop in order to display the iteration number, current approximation, and the absolute error after each iteration. Also, display the exact value at the end of the program using fprintf. *Hint: built-in functions,factorial) and abs() (b) If you integrate cos (t) from t = 0 to t = b, for what value of b does the integral become 0.5? Use a while loop to stop the iteration when the integral is greater than or equal to 0.5. Generate a text output on the screen that reports the upper limit b and the integral
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
