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

    %% Plot Single Data Series  
% Create a stairstep plot of sine evaluated at 40 equally spaced values
% between 0 and $4\pi$.   

% Copyright 2015 The MathWorks, Inc.


%%  
X = linspace(0,4*pi,40);
Y = sin(X);

figure
stairs(Y)    

%%
% The length of |Y| automatically determines and generates the _x_-axis scale.