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

    %% Plot Multiple Data Series  
% Create a stairstep plot of two cosine functions evaluated at 50 equally
% spaced values between 0 and $4\pi$.   

% Copyright 2015 The MathWorks, Inc.


%%  
X = linspace(0,4*pi,50)';
Y = [0.5*cos(X), 2*cos(X)];

figure
stairs(Y)    

%%
% The number of rows in |Y| automatically determines and generates the
% _x_-axis scale.