The Taylor's series expansion for cosx about x = 0 is given by: where x is in

Question:

The Taylor's series expansion for cosx about x = 0 is given by:
The Taylor's series expansion for cosx about x = 0

where x is in radians. Write a user-defined function that determines cosx using Taylor's series expansion. For function name and arguments, use y = cosTay (x), where the input argument x is the angle in degrees and the output argument y is the value for cosx. Inside the user-defined function, use a loop for adding the terms of the Taylor's series. If an is the nth term in the series, then the sum Sn of the n 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 Use cosTay for calculating:
(a) cos67°
(b) cos200°
(c) cos-80°.
(d) cos794°
(e) cos20000°.
(f) cos-738°
Compare the values calculated using cosTay with the values obtained by using MATLAB's built-in cosd function.

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

Step by Step Answer:

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