34. The Taylor series expansion for about is given by: where x is in radians. Write a...
Question:
34. The Taylor series expansion for about is given by:
where x is in radians. Write a user-defined function that determines using Taylor’s series expansion. For function name and arguments, use y=sinTay(x), where the input argument x is the angle in degrees and the output argument y is the value of . Inside the user-defined function, use a loop for adding the terms of the Taylor series. If is the nth term in the series, then the sum of the n terms is . In each pass, calculate the estimated error E given by . Stop adding terms when userdefined function such that if the angle is larger than 360°, or smaller than –360°, then the Taylor series will be calculated using the smallest number of terms (using a value for x that is closest to 0).
Use sinTay for calculating:
(a)
(b)
(c) .
(d)
(e) (f)
Compare the values calculated using sinTay with the values obtained by using MATLAB’s built-in sind function.
Step by Step Answer: