Question: Problem 3: (You need to do this problem in Matlab first, then copy your scripts and results as your solution) (1) Write a Matlab function

Problem 3: (You need to do this problem in Matlab first, then copy your scripts and results as your solution) (1) Write a Matlab function M-file to compute the Maclaurin series expansion for the cosine function as described in Problem 3. The function should have the following features: Iterate until the relative error falls below a stopping criterion (es) or exceeds a maximum number of iterations (maxit). Allow the user to specify values for x, es, and maxit. Return the estimate of cos(x), the approximate percent relative error, the number of iterations. (2) What are your estimate of cos(x), the approximate percent relative error, and the number of iterations with the input as x=2/3, the stopping criterion resulting in at least 2 significant digits, and maxit=100 by running your script in Matlab? Do these results agree with what you got from problem 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
