Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions