www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/SpecifyDifferentLineStylesForMultipleLinesExample.m

    %% Specify Different Line Styles for Multiple Lines
% This example shows how to plot two sine waves with different line styles
% by adding a line specification to each |x,y| pair. 

%%
% Plot the first sine wave with a dashed line using |'--'|. Plot the second
% sine wave with a dotted line using |':'|.
x = linspace(0,2*pi,100);
y1 = sin(x);
y2 = sin(x-pi/4);

figure
plot(x,y1,'--',x,y2,':')