Question: Using Matlab The sine function can be evaluated by the following infinite series: As a test case, compute sin(0.9) for up to and including eight

Using Matlab

The sine function can be evaluated by the following infinite series:

Using Matlab The sine function can be evaluated

As a test case, compute sin(0.9) for up to and including eight termsthat is, up to the term x15/15!.

Utilizing a for-loop, compute and display in sequence the values for all 8 terms as shown below. The neatly formatted output should include the iteration number and computed term and %error.

Using Matlab The sine function can be evaluated

 Using Matlab The sine function can be evaluated by the following

...

For each of the preceding, compute and display the percent relative error as

Using Matlab The sine function can be evaluated

This will be done with 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 computation.

3C 3C ... 31 51

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