Hi all, how would I plot every iteration of the sum? It's and approximation of cos, getting closer each iteration. Thank you in advance!
x = -pi:0.1:pisum = 0;n=(1:1:5);for k = 0:n kTerm = ((-1).^(k)).*((x.^(2.*k)))./(factorial(2.*k)); sum = sum + kTerm;endsumhold on; grid onplot (x, sum, ':b')plot (x, ye, '-r');
Best Answer