Plotting and Links
Here is a more advanced example and a link to another tutorial on plotting.
Multiple Plots
For the more adventursome, here is an example file that plots multiple
curves in colors:
% everything following a % sign is ignored by Matlab.
%
t = 0:0.0001:.05; % create a vector from 0 to .05 in .0001 increments
omegad = 200*2*pi
y1 = cos(omegad*t);
y2 = sin(omegad*t);
plot(t,y1,'r-',t,y2,'g--') % plot command with red solid line and green dashed line.
title('sine and cosine') %labels and titles.
xlabel('time (s)') %these must appear after the
ylabel('x(t)') %plot command.
print sines -dps %creates a file called sines.ps that you can print from UNIX.
The print command is not needed on PC/MAC unless you want to save the file
for posterity.
More Information on Plotting
For a more complete Matlab tutorial on plotting see plotting
tutorial. This page provides a good reference in general.