MATLAB Functions | Help Desk |
stairs
Stairstep plotstairs(Y)
stairs(X,Y)
stairs(...,LineSpec
)
[xb,yb] = stairs(Y)
[xb,yb] = stairs(X,Y)
Stairstep plots are useful for drawing time-history plots of digitally sampled data systems.
stairs(Y)
draws a stairstep plot of the elements of Y
. When Y
is a vector, the x-axis scale ranges from 1
to size(Y)
. When Y
is a matrix, the x-axis scale ranges from 1
to the number of rows in Y
.
stairs(X,Y)
plots X
versus the columns of Y
. X
and Y
are vectors of the same size or matrices of the same size. Additionally, X
can be a row or a column vector, and Y
a matrix with length(X)
rows.
stairs(...,LineSpec
)
specifies a line style, marker symbol, and color for the plot.
[xb,yb] = stairs(Y) and [xb,yb] = stairs(x,Y)
do not draw graphs, but return vectors xb
and yb
such that plot(xb,yb)
plots the stairstep graph.
Create a stairstep plot of a sine wave: bar
, hist