Question: MATLAB Maclaurin Write a program to compute cos(x) ( where x is in radians ) correct to five decimal places using the Maclaurin series below.
MATLAB Maclaurin
Write a program to compute cos(x) (where x is in radians) correct to five decimal places using the Maclaurin series below. Keep track of how many terms are necessary to reach a five decimal place agreement between the approximation (Maclaurin series) and the actual value of cos(x). Print the actual and approximation values for cos(x) to seven decimal places and the number of terms needed to reach a five decimal place agreement to the command window. The program will prompt the user to enter the value of x (in radians). You may use the MATLAB built-in function, factorial, to calculate the factoria
cos() = 1 ^2 /2! + ^4/4! ^6/6! +
To demonstrate the effectiveness of your program run it with an input value of x=19.3. Submit your .m file and the output to the command window.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
