ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

MATLAB_实验_3

2022-04-28 23:00:15  阅读:148  来源: 互联网

标签:subplot plot %% 实验 MATLAB y1 y3 y2


%% 1.
x=0 :pi / 50 : 2pi;
y=(0.5+3
sin(x)./(1+x.x)).cos(x);
plot(x,y);
%% 2.
%(1)
x=0:0.1:100;
y1=x.^2;
y2=cos(2x);
y3=y1.
y2;
plot(x,y1,'m.');
hold on;
plot(x,y2,'g.');
hold on;
plot(x,y3,'y.');
hold off
%(2)
x=0:0.1:100;
subplot(3,1,1);
y1=x.^2;
plot(x,y1);
legend('y1=x.^2');
title('y1');
subplot(3,1,2);
y2=cos(2x);
plot(x,y2);
legend('y2=cos(2
x)');
title('y2');
subplot(3,1,3);
y3=y1.y2;
plot(x,y3);
legend('y3=y1.
y2');
title('y3');
%(3)
subplot(4,1,1),bar(x,y1);
subplot(4,1,2),stairs(x,y1);
subplot(4,1,3),stem(x,y1);
subplot(4,1,4),fill(x,y1,'k');
subplot(4,1,1),bar(x,y2);
subplot(4,1,2),stairs(x,y2);
subplot(4,1,3),stem(x,y2);
subplot(4,1,4),fill(x,y2,'k');
subplot(4,1,1),bar(x,y3);
subplot(4,1,2),stairs(x,y3);
subplot(4,1,3),stem(x,y3);
subplot(4,1,4),fill(x,y3,'k');
%% 3.
x=-5:0.01:5;
y=(x+sqrt(pi))/exp(2).(x>=-5&x<=0)+(1/2)log(x+sqrt(1+x.^2)).(x>0&x<=5);
plot(x,y);
%% 4.
theta=0:0.01:2
pi;
rho=1sin(1theta);
polar(theta,rho);
theta=0:0.01:2pi;
rho=2
sin(2theta+2);
polar(theta,rho);
%% 5.
x=-8:8;
y=-8:8;
[x,y]=meshgrid(x,y);
z=sin(sqrt(x.2+y.2))./sqrt(x.2+y.2);
subplot(3,1,1),plot3(x,y,z);
subplot(3,1,2),mesh(x,y,z);
subplot(3,1,3),surf(x,y,z);
%% 6.
x=-10:0.01:10;
y=(x.2+sqrt(sqrt(1+x))+5).*(x>0)+0.*(x==0)+(x.3+sqrt(1-x)-5).
(x<0);
plot(x,y);
%% 7.
x=[450.6;395.9;410.2;450.9];
season=[1;2;3;4];
subplot(1,2,1),bar(season,x);
subplot(1,2,2),pie(x);
%% 8.
x=-pi:pi;
y1=2*x-0.5;
plot(x,y1);
hold on;

t=0:0.01:pi;
x=sin(3.t).cos(t);
y=sin(3.t).sin(t);
plot(x,y);
hold off;

标签:subplot,plot,%%,实验,MATLAB,y1,y3,y2
来源: https://www.cnblogs.com/dhl-kzh/p/16204948.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有