个性化阅读
专注于IT技术分析

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 Y
stairs(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 t
t=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()

赞(0)
未经允许不得转载:srcmini » MATLAB函数stairs()

评论 抢沙发

评论前必须登录!