Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB The Taylor Series expansion for cosine is: cos(x s(x) = $ (-1) x?n wt (2n)! where x is an angle in radians. approxValue -
MATLAB
The Taylor Series expansion for cosine is: cos(x s(x) = $ (-1)" x?n wt (2n)! where x is an angle in radians. approxValue - trueValue The correct definition of relative error is: realtiveError == trueValue Craft a UDF that: accepts an angle in degrees as the 1st variable in input argument list accepts a value for convergence tolerance as the 2nd variable the in input argument list converts the angle from degrees to radian (x in series MUST be in radians) uses the above series to compute an approximate value for the cosine of the angle . For the purposes of this assignment, assume that the value computed by the MATLAB built-in function for cosine is the true value.) Uses the fprintf function to show in the CW in an easily red format on successive lines: - the angle in degrees, - the approximate value for the cosine computed using the specified relative error tolerance, - the specified relative error tolerance, and - the number of terms of the series required to produce the approximate value. Returns as output arguments, in the following order: - the series approximation value for the cosine, - the relative error, and - the number of terms required to compute the approximate value. Produces one plot with 5 curves, all on -2Step 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