Matlab练习笔记(二)

1.用plot3命令绘制下面的三维曲线
{ x = c o s t , t ∈ [ 0 , 2 π ]   y = s i n t   z = t s i n t c o s t   \begin{cases} x=cost , t\in [0, 2\pi ]& \text{ } \\ y=sint& \text{ } \\ z=tsintcost& \text{ } \end{cases} x=cost,t[0,2π]y=sintz=tsintcost   

t = 0:pi/100:2*pi;
x = cos(t);
y = sin(t);
z = t.*sin(t).*cos(t);
plot3(x, y, z)

在这里插入图片描述
2. 在xy平面选择区域 [-8, 8]x[-8, 8],利用mesh,surf,meshc,surfc绘制下面函数,要求子图在同一个图形窗口绘制,并添加标题说明
z = s i n x 2 + y 2 x 2 + y 2 z=\frac{sin\sqrt{x^{2}+y^{2}}}{\sqrt{x^{2}+y^{2}}} z=x2+y2 sinx2+y2

[x, y] = meshgrid(-8: 1:8); % 生成网格矩阵
z = sin(sqrt(x.^2+y.^2))./sqrt(x.^2+y.^2);
subplot(2, 2, 1); %分割图新窗口
mesh(x, y, z)
title('mesh');
subplot(2, 2, 2)
surf(x, y, z)
title('surf');
subplot(2, 2, 3);
meshc(x, y, z)
title('meshc');
subplot(2, 2, 4);
surfc(x, y, z)
title('surfc');

在这里插入图片描述
3.绘制光照处理后的球面,取三个不同的光照位置进行比较(提示:可以利用sphere函数和light命令)

subplot(2, 2, 1);
sphere(30);light('Color', [1, 1, 1], 'Style', 'local', 'Position', [-4, -1, 10]);
subplot(2, 2, 2);
sphere(30);light('Color', [1, 1, 1], 'Style', 'local', 'Position', [-1, <
  • 4
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值