Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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,
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, $$ e^{x}=1+x+\frac{x^{2}}{2 !}+\frac{x^{3}}{3 !}+\cdots+\frac{x^{n}}{n !}+\cdots $$ 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 \pi \leq x \leq 2 \pi$. c) Show a solid blue plus sign (+) on the same plot indicating the location of the estimated value of $x$. CS.VS. 1136||
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started