The Taylor series expansion for cos(x) is: where x is in radians. Write a MATLAB program that

Question:

The Taylor series expansion for cos(x) is:
The Taylor series expansion for cos(x) is:where x is in

where x is in radians. Write a MATLAB program that determines cos (x) using the Taylor series expansion. The program asks the user to type a value for an angle in degrees. Then the program uses a loop for adding the terms of the Taylor series. If an is the nth term in the series, then the sum Sn of then terms is sn €“ sn-1 + an. In each pass calculate the estimated error E given by E = sn €“ sn-1/sn-1. Stop adding terms when E (a) cos(35°)
(b) sin(125°)
Compare the values with those obtained by using a calculator.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: