MATLab Need help fixing MATLab Input to solve part B Part A

MATLab: Need help fixing MATLab Input to solve part B. Part A is already solved and I have provided my input so far for part B. My only problem is that the graph of mycos2(x) is not showing up in the plot. Please help!

Please note any other errors you might see in my MATLab input elsewhere. Once again, your help is much apprciated!

a.) Use MATLAB to create a plot of the cosine (solid line) along with a plot of the series expansion (black dashed line) up to and including the term x8/8! with a for- loop or while-loop such that the relative error is 10-5. Use the built-in function factorial in computing the series expansion. Make the range of the abscissa from x = 0 to 3n/2. b.) With MATLAB, define a multi-line subfunction \"mycos(x)\" that takes in a matrix \'x\' with the same algorithm as part a.). In addition, define an anonymous function \"mycos2(x)\" that takes in a scalar x by approximating co with a suitable number. Generate a graph of all three functions (mycos, mycos2, & cos) in the same plot.

Solution

Part B)

Nothing wrong. I have a doubt in r values, is it necessary values for the factorial.Once ignore the r values and check.

MATLab: Need help fixing MATLab Input to solve part B. Part A is already solved and I have provided my input so far for part B. My only problem is that the grap

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site