close all %plotting figure(1) x1=-10:.1:10; y1=sin(x1); plot(x1,y1) title('sine of x') xlabel('x vals') ylabel('y vals') hold on x2=linspace(-10,10,64); y2=sin(x2); plot(x2,y2,'y--') x3=[-9 -4 0 1 2 7]; y3=sin(x3); plot(x3,y3,'c') figure(2) plot(x1,y1,'rd',x2,y2,x3,y3,'g') legend('first','second','third',2) figure(3) subplot(3,2,1) plot(x1,y1) subplot(3,2,2) plot(x2,y2) subplot(3,2,3) plot(x3,y3) %saving data save A1.dat x1 -ASCII %printing figures figure(1) %makes fig1 the current figure print -djpeg fig1.jpg