专题四单元作业MATLAB绘图答案

绘制下列曲线:

在这里插入图片描述
要求分别用plot和fplot函数实现,并且在子图中绘制两个图形,两个子图水平排列。
话不多说上代码,代码

 x=linspace(-5,5,100); 
y=[(1/2*pi)*exp(-(x.*x)/2)];
subplot(1,2,1);
plot(x,y);
>> x1 =@(t) t.*t;
x2 = @(t) 5*(t.*t.*t);
>> subplot(1,2,2);
>> fplot(x1,x2);
>>

绘制曲面:
在这里插入图片描述
要求在3个子图中分别用plot3、mesh、surf函数绘制。

>> u=linspace(0,pi,100); 
>> v=linspace(0,pi,100);
>> x=(1+cos(u'))*cos(v);
>>  y=(1+cos(u'))*sin(v);
>> z=sin(u); 
>> subplot(1,3,1);
>> plot3(x,y,z)
>> z=[(1+cos(u)).*cos(v);(1+cos(u)).*sin(v);sin(u)];
>> subplot(1,3,2);
>> mesh(z);
>> subplot(1,3,3);
>> surf(z);
>> 
  • 10
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值