Question: 2. [70 points] Write a Matlab function exp_est (x,D) that accepts a scalar x and the number of desired significant digits of accuracy, D,
2. [70 points] Write a Matlab function exp_est (x,D) that accepts a scalar x and the number of desired significant digits of accuracy, D, and returns the value, y, of the polynomial approximation, 1+x+ 3! and its degree n. Your function must be complete with comments and error trapping if needed. It should default to D=5, if D is not specified in the function call. Your function should: a) Provide the true absolute relative error pertaining to the estimate b) Generate a dashed green plot of the exact function f(x)=cos(x), for-2 x2. c) Show a solid blue plus sign (+) on the same plot indicating the location of the estimated value of x.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
