Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Do a variation on exercise 7.5 on page 177 of the textbook. Do not implement an

ID: 2079629 • Letter: D

Question

Do a variation on exercise 7.5 on page 177 of the textbook. Do not implement an indefinite-length series. Instead, implement a fixed-length series that terminates at the seventh-power term. Test it in the range of -3 < x < +3.
Submit an m-file named: myexp_LastName.m.

7.5 Write your own MATLAB function to compute the exponential function directly from the Taylor series: 2! The series should end when the last term is less than 10 6. Test your function against the built-in function exp, but be careful not to make x too large-this could cause a rounding error

Explanation / Answer

format long;
n=1;
x=input('enter');
p=1;
while ((x^n/factorial(n))>10^(-6))
p=p+x^n/factorial(n);
n=n+1;
end
test=exp(x);
disp('series output is'); disp(p);
disp('test output is'); disp(test);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote