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
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