Question: Write a Matlab function to compute the n-degree Taylor polynomial Pn(x) of f(x) = ex (centered at x = 0), where n can be arbitrary.

Write a Matlab function to compute the n-degree Taylor polynomial Pn(x) of f(x) = ex (centered at x = 0), where n can be arbitrary. For the cases n = 4, n = 10, and n = 50, plot Pn(x) and f(x) on the same graph for x in the range 2 x 2. Choose an appropriate step size. Make sure to plot the two functions with different styles (for example, plot one as a line and the other as data points) so that they can be distinguished. You should make a separate plot for each n. Save each plot as a PNG file to be included in your lab report. For each case, also plot the error (absolute value of the difference) against x. So in total, you will have 6 plots

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!