Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve this problem in Matlab... As a test case, compute sin(0.9) for up to and including eight terms-that is, up to the term x^15/15!. Utilizing
Solve this problem in Matlab...
As a test case, compute sin(0.9) for up to and including eight terms-that is, up to the term x^15/15!. Utilizing a for-loop, compute and display in sequence the values for all 8 terms as shown below. Your neatly formatted output should include the iteration number and computed term and %error (formula given below) sin x = x sin x = x - x^3/3! Sin x = x - x^3/3! + x^5/5! For each of the preceding, compute and display the percent relative error as %error = true - series approximation/true times 100% In the above equation, the true value is the value you get from your calculator. In matlabe you can computer the true value of sine using the sin() function. Part b) Modify the above program to use a while loop. Your program will terminate when the %error is less than 008. Display the final calculated value for sin (0.9) and the number of iterations (number of loops) the program took for the computationStep 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