三维图形

三维图形

Task09 三维图形
语法知识
5.10.1三维线性图
plot3(x,y,z)。
5.10.2三维条形图
bar3(y) 绘制向量y的坐标图。
bar3(x,y)绘制向量y的每一个元素在指定x的条形图,x必须是递增的。
5.10.3三维散点图
scatter3(x,y,z) 。
5.11三维网格图
mesh(x,y,z,c)。
meshc(x,y,z,c)添加等高线。
meshz(x,y,z,c)添加门帘线。
5.12三维表面图
surf(x,y,z,c)。
5.13简易表面图
ezpsurf(f,domain) f函数表达式,domain自变量变化区间。
ezpsurf(x,y,z,[ ],[ ])。
实战演练
5.28

t=0:pi/50:10pi;
x=0.1
exp(t/20).cos(2t);
y=0.1*exp(t/20).sin(2t);
plot(x,y,t),grid on
plot3(x,y,t),grid on

5.29

year=[1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001];
GDP=[17.4 19.58 23.94 31.48 43.8 57.73 67.79 74.77 79.55 82.05 89.4 95.93];
consu=[3.1 3.4 10.7 19.6 24.8 16.5 8.3 2.8 -0.8 -1.4 0.4 0.7];
colormap(spring);%设置颜色
bar3(year,GDP,0.3)
figure %创建另一图形窗口
colormap([0 1 1])
bar3(year,consu,0.3)

5.30

for n=0:0.5:15
r=5+5n;
theta=0:pi/12:2
pi;
x=rcos(theta);
y=r
sin(theta);
z=50*ones(size(x))n-2n.^2;
c(1)=0;c(2)=0;c(1)=0;
scatter3(x,y,z,3,c,‘filled’)
hold on
end
axis([-80,80,-80,80,0,320])

5.31

[X,Y]=meshgrid(-3:0.2:3);
Z=exp(-X.2-Y.2).*sin(X).^2;
mesh(X,Y,Z)

5.32

[X,Y]=meshgrid(-3:0.2:3);
Z=exp(-X.2-Y.2).*sin(X);
meshc(X,Y,Z)
axis([-3 3 -3 3 -0.3 0.3])

5.33

A=pascal(9);
surf(A)

5.34

B=magic(9);
surf(B)

5.35

[x,y]=meshgrid(0:0.25:10);
z=exp(-(0.15*x).2-(0.15*y).2).*sin(x).*sin(y);
surfc(x,y,z)

5.36

ezsurf(‘x*exp(-x2-y2)’,[-3,3],[-3,3]);

5.37

syms r theta
x=rcos(theta);
y=r
sin(theta);
z=r*2;
ezsurf(x,y,z)

学习心得
学习了三维线性图,三维条形图,三维散点图,三维网格图,三维表面图,简易表面图。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值