Table Of Contents


    Last Modified: January 9, 2017

    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.


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


    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)



    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.


    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

    Colors the plot blue.


    Colors the plot cyan.


    Colors the plot green.


    Colors the plot black.


    Colors the plot magenta.


    Colors the plot red.


    Colors the plot white.


    Colors the plot yellow.


    Marks points with dots.


    Marks points with circles.


    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.



    Matrix you can use to plot stairstep graphs.


    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

    Recently Viewed Topics