1552 1

MATLAB课程:代码示例之Graphics and Visualization(一) [推广有奖]

企业贵宾

已卖:160份资源

巨擘

0%

还不是VIP/贵宾

-

威望
4
论坛币
624047 个
通用积分
180.5582
学术水平
918 点
热心指数
987 点
信用等级
841 点
经验
399203 点
帖子
9786
精华
48
在线时间
17322 小时
注册时间
2014-8-19
最后登录
2022-11-2

楼主
widen我的世界 学生认证  发表于 2016-3-8 14:31:37 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

MATLAB课程:代码示例之Graphics and Visualization(一)


Creating 2-D Plots


This example shows how to create a variety of 2-D plots in MATLAB®.


Line Plots

The plot function creates simple line plots of x and y values.

x = 0:0.05:5;y = sin(x.^2);figureplot(x,y)


Line plots can display multiple sets of x and y data.

y1 = sin(x.^2);y2 = cos(x.^2);plot(x,y1,x,y2)


Bar Plots

The bar function creates vertical bar charts. The barh function creates horizontal bar charts.

x = -2.9:0.2:2.9;y = exp(-x.*x);bar(x,y)


Stairstep Plots

The stairs function creates a stairstep plot. It can create a stairstep plot of Y values only or a stairstep plot of x and y values.

x = 0:0.25:10;y = sin(x);stairs(x,y)


Errorbar Plots

The errorbar function draws a line plot of x and y values and superimposes a vertical error bar on each observation. To specify the size of the error bar, pass an additional input argument to the errorbar function.

x = -2:0.1:2;y = erf(x);eb = rand(size(x))/7;errorbar(x,y,eb)


Polar Plots

The polarplot function draws a polar plot of the angle values in theta (in radians) versus the radius values in rho.

theta = 0:0.01:2*pi;                      % anglerho = abs(sin(2*theta).*cos(2*theta));    % radiuspolarplot(theta,rho)


Stem Plots

The stem function draws a marker for each x and y value with a vertical line connected to a common baseline.

x = 0:0.1:4;y = sin(x.^2).*exp(-x);stem(x,y)


Scatter Plots

The scatter function draws a scatter plot of x and y values.

load patients Height Weight Systolic    % load datascatter(Height,Weight)                  % scatter plot of Weight vs. Heightxlabel('Height')ylabel('Weight')


Use optional arguments to the scatter function to specify the marker size and color. Use the colorbar function to show the color scale on the current axes.

scatter(Height,Weight,20,Systolic)    % color is systolic blood pressurexlabel('Height')ylabel('Weight')colorbar




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:MATLAB课程 Graphics GRAPHIC MATLAB Visual MATLAB课程 代码示例 GraphicsandVisualization Creating2-DPlots


https://www.cda.cn/?seo-luntan
高薪就业·数据科学人才·16年教育品牌

沙发
good1234 学生认证  发表于 2016-3-8 14:32:08
受教,thanks

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-4 05:36