stairsStairs plot
stairs(y)y should be a real scalar, vector or matrix (array having 2 dimensions).y is a scalar, only the point [1, y] is plotted. (If no marker is used, the point will be invisible.y is a vector (row or column) of length k, a line of k data points is plotted.size(y) is a matrix of size [np,nl] with both np > 1 and nl > 1, then nl separate lines of np data points are plotted.y has a value of NaN, Inf or -Inf, the value is ignored and no point is shown for that value.y is real, it gives the same result as stairs(1:np, y), where np is the number of rows of y.y is complex, it gives the same result as stairs(1:np, real(y)).stairs(y,spec)stairs(y) above, but it has additional controls over line attributes using the specification string spec.spec should be a character vector specifying values of various line attributes.spec. The available ones are 'color', 'lineStyle' and 'marker'.'-r' means a solid line of red colour. An attribute value in a specification string can be over-written by a latter value in the same string. For example, '-.-' gives a solid line since '-.' (dash-dotted line) is overwritten by '-' (solid line). Similarly, 'blackred' gives a red line, instead of a black one.spec applies to all lines generated for y. Hence all lines have the same line and marker styles specified by spec.stairs(1:np, y, spec) where np is the number of rows of y.stairs(y,name1,value1,...,nameN,valueN)stairs(y,spec,name1,value1,...,nameN,valueN)name1, ..., nameN are attribute names, and value1, ..., valueN are their associated values.spec, can be overwritten by value1, ..., valueN.stairs(x,y)stairs(x,y,spec)stairs(x,y,name1,value1,...,nameN,valueN)stairs(x,y,spec,name1,value1,...,nameN,valueN)x and y should be scalars, vectors, or matrices of numeric values.
If y has size [m, n], where m >= 1 and n >= 1, then x should be either a matrix of the same size, or a vector of length m or n:
x is a matrix, then n lines of m data points will be plotted.x is a vector of length m, then n lines of m data points will be plotted. x is a vector of length n, then m lines of n data points will be plotted.If x or y is complex, only the real parts will be used.
See stairs(y, 'spec') above for the description of the line specification string spec.
name1, ..., nameN are attribute names, and value1, ..., valueN are their associated values.
x = linspace(-2*pi,2*pi,50);
y = sin(x);
stairs(x,y,'-o')
hold
plot(x,y)

stairs(x,y) with y being a matrix, where np is the number of data points, and nl is the number of lines. Since x is a vector, all 3 stairs plots have the same np = 20;
nl = 3;
y = rand(np,nl);
x = 1:np;
stairs(x,y,'-o')
legend('show')
legend('Stairs 1','Stairs 2','Stairs 3')

y = 1:10;
x = 1:10;
stairs(x,y,'-rs','markersize',4,'markerfacecolor',[.4 .6 .7],'linewidth',3)
