2.5 二维图形绘制

>> cd

G:\0训练\code\MATLAB

>> x=[-pi : 0.05 : pi];
>> y=sin(tan(x))-tan(sin(x));
>> plot(x,y)


>> x=[-pi:0.05:-1.8,-1.799:0.001:-1.2,-1.199:0.05:1.2,1.201:0.001:1.8,1.81:0.05:pi];
>> y=sin(tan(x))-tan(sin(x));
plot(x,y)


>> x=[-2:0.02:2];y=1.1*sign(x).*(abs(x)>1.1)+x.*(abs(x)<=1.1);
plot(x,y)

6565

56456

456456

5456

>> x=0:0.01:2*pi;
>> y1=sin(x);
>> y2=0.1*cos(x);
>> plot(x,y1,x,y2,'--')

>> plotyy(x,y1,x,y2)

2

456456

>> theta=0:0.01:6*pi;
>> rho=5*sin(4*theta/3);
>> polar(theta,rho)

 
>> figure;rho=5*sin(theta/3);polar(theta,rho)

 

 

 

 

 

>> figure;rho=5*sin(theta/3);polar(theta,rho)
>> t=0:0.2:2*pi;y=sin(t);
>> subplot(2,2,1),stairs(t,y);subplot(2,2,2),stem(t,y);subplot(2,2,3),bar(t,y);subplot(2,2,4),semilogx(t,y)

 

ezplot('x^2*sin(x+y^2)+y^2*exp(x+y)+5*cos(x^2+y)',[-10 10]);

subplot(2,2,1),ezplot('x^2*sin(x+y^2)+y^2*exp(x+y)+5*cos(x^2+y)',[-10 10]);
subplot(2,2,2),ezplot('x^2*sin(x+y^2)+y^2*exp(x+y)+5*cos(x^2+y)',[-20 20]);
subplot(2,2,3),ezplot('x^2*sin(x+y^2)+y^2*exp(x+y)+5*cos(x^2+y)',[-50 50]);
subplot(2,2,4),ezplot('x^2*sin(x+y^2)+y^2*exp(x+y)+5*cos(x^2+y)',[-100 100]);

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值