% credit http://www.cyclismo.org/tutorial/matlab/vector.html %fails: %for x=1:2000, % g=x./1000; % y=sin(g); %end %y=[1:10]; %x=[1:10]; sum=0; for i=1:10 xx=i/10.; x(i)=xx; sum=sum+xx*step; y(i)=sum; end subplot(1,2,1); plot(x, x,'g'); subplot(1,2,2); plot(x, y,'r'); hold on plot(x, y,'bo'); title('y(x)'); xlabel('x'); ylabel('Integral'); %print -dpng myplot.png; y Copyright (C) 2009 Konstantin Kirillov