Question: Question: + .. 2. Write A Function That Computes The Approximate Value Of Cos X Using Taylor's Series X X X Cos X = 1

Question: + .. 2. Write A Function That Computes The Approximate Value Of Cos X Using Taylor's Series X² X X Cos X = 1 - 2! ' 4! 6! The2. Write a function that computes the approximate value of cos x

2. Write a function that computes the approximate value of cos x using Taylor's series x x x cosx=1 2! 4! 6! The function should use the while loop, which is terminated when the magnitude of the last term becomes smaller than 10%. The function should output the value of the truncated series as well as, as an option, the number of terms that were used in the calculation. Use your function for x = myvec (1) and compare the result to cos (x) evaluated in Matlab. Is the difference smaller than 10-8?

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 Accounting Questions!