Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

stairs (MathScript Function) (Windows, Not in Base Package)

Member of the plots class.

Syntax

stairs(x, y)

stairs(y)

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

[x0, y0] = stairs(y)

Description

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

Inputs

Name Description
x Specifies a real matrix. 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.
y Specifies a real matrix.

Outputs

Name Description
x0 Returns a matrix that you can use to plot stairstep graphs.
y0 Returns a matrix that you can use to plot stairstep graphs.

Examples

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

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


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit