Question: 1. The sine function can be evaluated by its Taylor's series: sinx=x3!x3+5!x5 where x is in radians. Write a user-defined function that determines sinx using

 1. The sine function can be evaluated by its Taylor's series:

1. The sine function can be evaluated by its Taylor's series: sinx=x3!x3+5!x5 where x is in radians. Write a user-defined function that determines sinx using Taylor's series expansion. For function name and arguments, use y= sinTaylor (x), where the input argument x is the angle in degrees and the output argument y is the value for sinx. Inside the user-defined function, use a loop for adding the terms of Taylor's series. If an is the nth term in the series, then the sum Sn of the n terms is Sn=Sn1+an. In each loop, calculate: - the absolute true error ea=sin(x)f(x) - the relative true error er=sin(x)ea - the relative approximate error e=f(xcurrent)f(xcurrent)f(xprevious) where f(x) is your approximation of the sine function. For the true value of sinx, use MATLAB embedded function sin. Stop adding terms when e106. Use sinTaylor for calculating sin25 and sin195. Discuss the observation in your submission

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!