Matlab Subplots images/first slide previous slide next slide last slide       Intro Matlab Graphics       Academic Computing                


Subplots



subplot - display multiple plots in the same window
subplot (nrows,ncols,plot_number)

Try:

 x=0:.1:2*pi;
subplot(2,2,1);
plot(x,sin(x));
subplot(2,2,2);
plot(x,cos(x));
subplot(2,2,3)
plot(x,exp(-x));
subplot(2,2,4);
plot(peaks);

picture of 4 plots made using subplot command