Answered step by step
Verified Expert Solution
Link Copied!

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,

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions