The Taylor series expansion for cos(x) is: where x is in radians. Write a MATLAB program that
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Related Book For
Principles of Communications Systems, Modulation and Noise
ISBN: 978-8126556793
7th edition
Authors: Rodger E. Ziemer, William H. Tranter
Posted Date: