
66
MATLAB Graphics and Plotting
3.4.1 Multiple Plots on a Window
Following are the two ways to plot multiple functions in a single window:
1. Using a single plot command: The first one is to use only one plot command with the
parameters for all functions to be plotted.
2. Using multiple plot commands: The second one is to use multiple plot commands but
use the hold on command to plot all curves in a single window.
This example illustrates the usage of a single plot command. The following M-file can be
used to plot a sine wave and a cosine wave on the same set of axes, using different colors and
point markers:
mult_plot1.m
X = linspace(0,2*pi,50); ...