MATLAB函数stairs()

阶梯图对于绘制数字采样记录系统的时间历史图非常有用。
句法

stairs(Y) // It draws a stairstep plot of the items of Y. When Y is the vector, the x-axis scale range from 1 to the size(Y). When Y is the matrix, the x-axis scale range from 1 to the number of rows in Ystairs(X, Y) // It plots X versus the columns of Y. X and Y are vectors of a similar size or matrices of a similar size. X can be the row or a column vector, and Y a matrix with length(X) rows.stairs(..., LineSpec) // It specifies a-line style, marker symbol, and color for the plots.

例子
创建情节
r^2=2sin5t, 0≤t≤2πy= r sin tt=linspace(0, 2*pi, 200); r=sqrt(abs(2*sin(5*t))); y=r.*sin(t); stairs(t, y); axis[0 pi 0 inf]);

【MATLAB函数stairs()】输出
MATLAB函数stairs()

文章图片

    推荐阅读