# stairs

Version:

Returns matrices you can use to plot stairstep graphs. stairs(y) is equivalent to stairs(1:size(y,1),y). If you do not request an output, this function plots stairstep graphs in the current plot window.

Note

When you use the function stairs without an output, you can only use this function in the MathScript Console.

## Syntax

stairs(y)
stairs(y, attributes)
stairs(x, y)
stairs(x, y, attributes)
[x0, y0] = stairs(y)
[x0, y0] = stairs(y, attributes)
[x0, y0] = stairs(x, y)
[x0, y0] = stairs(x, y, attributes)

## x

Real matrix. The elements in x must be in ascending order. If y is a vector, x must be a vector of the same length. If y is a matrix, x must be a matrix of the same size or an array whose length is equal to the number of rows in y.

Real matrix.

## attributes

Valid plot attributes. Order the plot attributes by color, point style, and line style. For example, 'bo-' specifies that the plot is blue, marks points with circles, and uses solid lines. attributes is a string that accepts a combination of the following values:

Name Description
'b'

Colors the plot blue.

'c'

Colors the plot cyan.

'g'

Colors the plot green.

'k'

Colors the plot black.

'm'

Colors the plot magenta.

'r'

Colors the plot red.

'w'

Colors the plot white.

'y'

Colors the plot yellow.

'.'

Marks points with dots.

'o'

Marks points with circles.

'x'

Marks points with crosses.

'+'

Marks points with plus signs.

'*'

Marks points with asterisks.

'-'

Uses solid lines.

':'

Uses dotted lines.

'-.'

Uses dashed and dotted lines.

'--'

Uses dashed lines.

## x0

Matrix you can use to plot stairstep graphs.

## y0

Matrix you can use to plot stairstep graphs.

[X0, Y0] = stairs(1:10, rand(1, 10));
plot(X0, Y0)
[X0, Y0] = stairs(rand(1, 10));
plot(X0, Y0)

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported