您当前的位置: 首页 >  matlab

jeff one

暂无认证

  • 0浏览

    0关注

    220博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

MATLAB 视点处理

jeff one 发布时间:2022-01-14 00:02:52 ,浏览量:0

MATLAB 视点处理

view函数的基本方法 view(az,el) , 其中,az为方向角,el为仰角。

eg: 在这里插入图片描述

[x,y]=meshgrid(0:0.1:2,1:0.1:3);
z=(x-1).^2+(y-2).^2-1;
subplot(2,2,1);
mesh(x,y,z)
title('方位角=-37.5{\circ},仰角=90{\circ}')
subplot(2,2,2);
mesh(x,y,z)
view(0,90);
title('方位角=0{\circ},仰角=90{\circ}')
subplot(2,2,3);
mesh(x,y,z)
view(90,0);
title('方位角=90{\circ},仰角=0{\circ}')
subplot(2,2,4);
mesh(x,y,z)
view(-45,-60);
title('方位角=-45{\circ},仰角=-60{\circ}')

在这里插入图片描述

色彩处理 [R G B ] 红绿蓝

色图(Colormap):

cmap=colormap(parula(5))

eg:

surf(peaks)
colormap hot

在这里插入图片描述 在这里插入图片描述

eg:创建一个灰色系列色图矩阵。

c=[0,0.2,0.4,0.6,0.8,1]';
cmap=[c,c,c];%cmap=gray(6);
surf(peaks)
colormap(cmap)

在这里插入图片描述

eg:使用同一色图,以不同着色方式绘制圆锥体。

[x,y,z]=cylinder(pi:-pi/5:0,10);
colormap(lines);
subplot(1,3,1);
surf(x,y,z);
shading flat
subplot(1,3,2);
surf(x,y,z);
shading interp
subplot(1,3,3);
surf(x,y,z);

在这里插入图片描述

图形的剪裁处理

eg:绘制3/4圆

%eg:绘制3/4圆。
t=linspace(0,2*pi,100);
x=sin(t);
y=cos(t);
p=y>0.5;
y(p)=NaN;
plot(x,y)
axis([-1.1,1.1,-1.1,1.1])
axis square
grid on

在这里插入图片描述

eg:绘制3/4球面

[X,Y,Z]=sphere(60);
p=Z>0.5;
Z(p)=NaN;
surf(X,Y,Z)
axis([-1,1,-1,1,-1,1])
axis equal
view(-45,20)

在这里插入图片描述

关注
打赏
1661150981
查看更多评论
立即登录/注册

微信扫码登录

0.0417s