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

MATLAB函数Bar()

点击下载

条形图是其中每个点都由垂直条或水平条表示的图。

句法

bar(y) // It creates a bar graph with one bar for each element in y.
bar (x, y) // This function creates a vertical bar plot, with the values in x used to label each bar and the values in y used to determine the height of the bar.

例子

创建条形图

r^2=2 sin 5t, 0≤t≤2π
y = r sin t
t=linspace (0, 2*pi, 200);
r=sqrt(abs(2*sin(5*t)));
y=r.*sin(t);
bar (t, y)
axis ([0 pi 0 inf]);

输出

MATLAB Bar()

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

评论 抢沙发

评论前必须登录!