Question: Matlab: Can you please help? PROBLEM 5. points 30 - Use MATLAB The Maclaurin series expansion for the cos x is defined as 26 28
Matlab: Can you please help?
PROBLEM 5. points 30 - Use MATLAB The Maclaurin series expansion for the cos x is defined as 26 28 COS 2 = + x2 x4 + 2 4! 6! (2) 8! Determine the number of terms necessary to approximate cos(7/3) to eight significant figures using the Maclaurin approximation (2). The following criterion should be used to ensure that the result is correct to at least n significant figures: g = (0.5 x 102-1) % (3) I After each new term is added, compute the true and approximate percent relative errors. Use Matlab's built-in function cos to determine the true value. Write a script file in MATLAB in a similar way you did in class for the function exp x. Also generate one plot for the value of cos x versus number of iterations and another plot for the true and approximate relative percent errors, eqs. (4) and (5) respectively, versus number of iterations. Hint: Express the summed terms in eq. (2) with a infinite series sum. Appendix A Formulas for true and approximate per- centage errors [true value] [approximate value] (4) [true value] x 100% Et =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
