please use matlab to do it thanks? dSs eAercise Maclaurin series: Write down a f
ID: 2088132 • Letter: P
Question
please use matlab to do it thanks? dSs eAercise Maclaurin series: Write down a function "IterMeth.m" that accepts three inputs: x es, and maxit and evaluate the following series x- value at which series is evaluated es-stopping criterion (90 error between current and previous value in the iteration maxit- maximum number of iteration 35 Click to add notesExplanation / Answer
function Maclaurin n=5; x=input('enter the x value: ') epsilon_s=(0.5*10^(2-n)) epsilon=100 maclaurin(1)=1 iteration=1 while epsilon>epsilon_s iteration=iteration+1 maclaurin(iteration)=maclaurin(iteration-1)+(x)^(iteration-1)+x^(2+(iteration-1))/factorial(2+(iteration-1)) epsilon=abs((maclaurin(iteration)-maclaurin(iteration-1))/maclaurin(iteration)) end disp(['number of iterations= ',num2str(iteration)]) disp(['epsilon= ',num2str(epsilon)])
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.