Question: Write code and solve in Matlab The value of s i n ( x ) can be approximated as s i n ( x )

Write code and solve in Matlab
The value of sin(x) can be approximated as
sin(x)=x-x33!+x55!-x77!+cdots+xnn!
Develop a program using the break command to end the loop once the convergence criterion is met. Determine convergence by comparing successive values of the summation as you add additional terms to the series. These successive sums should be within an absolute value of 0.001 of each other. Test your function by evaluating the sin of 2 with your code and compare it to the built in MATLAB sin function.
Hint: Break this down into a couple of steps.
Use a for loop to create an alternating harmonic series (HW 9 practice 4).
Use a for loop to create a series of only odd numbers (1,3,5,7dots)
Combine all these elements to create the code for this problem.
Write code and solve in Matlab The value of s i n

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