Question: Here is the MATLAB code to be modified: And this is the problem: I completed part one two and six, please do 4 and 5
Here is the MATLAB code to be modified:

And this is the problem:
I completed part one two and six, please do 4 and 5
Tips: do NOT try to write the complete, fully-functional routine all at once! Better is to work on the individual pieces, test them independently, then assemble together for the final functional version. calculate exp (x), given x and N (number of terms) 8 this is the sum of terms and our final answer xt- 1; 8 first term is 1, so let's just put it in to start fact 1; factorial of first term is also 1 so put it in here for i 1:N now lets add N terms, as requested by user calculate numerator of next term (xi) xt x xt fact fact i; calculate denominator of next term (i!) s s xt/fact; add term to total sum and go back for more en & calculate sin (x), given x and N (number of terms) 8 1st term in series is x so put it here 8 used to compute next term SEX xtEx fact 1; 8 factorial of first terms is 1 also so put here sgn 1; 8 here is the sign We start with +1. for i 3:2 :N 8 cheap way to alternate sign on each successive term Sgni Sgn 8 numerator x i, given x (i-2) from previous time xt fact fact it (i-1) 8 calculate denominator factorial skipping by 2 SE s s gn xt/fact; 8 add term to total sum end 8 calculate cos (x), given x and N (number of terms) s 1; xt- 1; fact 1; sgn- 1; for i 2:2 N S gn; Sgns xt xt x x; fact-fact i (i-1); s-s sgn xt/fact; end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
