MATLAB: How to draw the power series in matlab

matlab plot

I want to draw the series without using cycle such as "for".The general term of the series is 1/n!, so what should I do?

Best Answer

%range of n=25
n = 0:25;
y = cumsum(1./factorial(n));
% plot results
plot(n,y,'r')
Related Question