% Script file to create multiple graphs on 1 axis
%
% Save this file as script1.m in your working directory
% then type
% >> script1
% at the command line
%
% Make sure that your browser does not add additional
% extensions to the file name when you download it.
% Firefox tends to do this.
% In a script file, the % symbol is used for comments
% Start clean
close all
clear
% Generate data
x = linspace(-pi,pi,51)';
y = sin(x);
z = cos(x);
w = cos(x).*sin(x);
% Generate plot
figure(1)
hold on
plot(x,y,'r*-')
plot(x,z,'b.-')
plot(x,w,'go-')
hold off
legend('sin(x)','cos(x)','cos(x)*sin(x)')