📜  MATLAB 2D Stairs()

📅  最后修改于: 2021-01-07 02:43:14             🧑  作者: Mango

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]);

输出: