Matlabwilliam hill官网
直播中

的乏味而

13年用户 801经验值
私信 关注
[资料]

matlab中运用plot绘制各种图形

常使用的plot命令所能绘制出的图形的类型,另外还有些其他的图形
PDF格式的文件是从mathworks公司官方网站下载的,权当些资料看看吧
游客,如果您要查看本帖隐藏内容请回复

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
x=-4:0.2:4;
y=x;
[x,y]=meshgrid(x,y);
z=x.^2/9+y.^2/9;
subplot(1,2,1);
mesh(x,y,z);
title('椭圆抛物面网格线');
subplot(1,2,2);
surf(x,y,z);
title('椭圆抛物面网面线');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(2)
x=-4:0.2:4;
y=x;
[x,y]=meshgrid(x,y);
z=x.^2/9-y.^2/9;
subplot(1,2,1);
mesh(x,y,z);
title('马鞍面网格线');
subplot(1,2,2);
surf(x,y,z);
title('马鞍面网面线');
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(3)
x=-7.5:0.5:7.5;
y=x;
[x,y]=meshgrid(x,y);
r=sqrt(x.^2+y.^2)+eps;
z=sin(r)./r;
subplot(1,2,1);
mesh(x,y,z);
title('阔边帽网格线');
subplot(1,2,2);
surf(x,y,z);
title('阔边帽网面线');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(4)
x=-7.5:0.5:7.5;
y=x;
z=3*(1-x).^2.*exp(-(x.^2)-(y+1).^2)-10*(x/5-x.^3-y.^5).*exp(-x.^2-y.^2)...
    -1/3*exp(-(x+1).^2-y.^2)
subplot(1,2,1);
mesh(peaks);
title('峰形函数的网格线');
subplot(1,2,2);
surf(peaks);
title('峰形函数的网面线');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(5)
[x,y,z]=peaks;
subplot(2,2,1);
contour(z,20)
subplot(2,2,2);
contour(x,y,z,20)
subplot(2,2,3);
contour3(z,20)
subplot(2,2,4);
contour3(x,y,z,20)
colormap(cool)
hidden on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(6)
[x0,y0,z0]=sphere(30)
x=2*x0;y=2*y0;z=2*z0;
clf,subplot(1,2,1)
surf(x0,y0,z0)
shading interp
hold on ,mesh(x,y,z),colormap(hot),hold off
hidden off
axis equal ,axis off
title('透视图')
subplot(1,2,2)
surf(x0,y0,z0)
shading interp
hold on ,mesh(x,y,z),colormap(hot),hold off
hidden on
axis equal ,axis off
title('消隐图')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(8)
t=(0:0.02:2)*pi;
x=sin(t);
y=cos(t);
z=cos(2*t);
plot3(x,y,z,'b-',x,y,z,'bd');
legend('链子','宝石')
box on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
figure(9)
t=(0:0.02:2);
x=sin(t);
y=cos(t);
z=cos(2*t);
plot3(x,y,z,'b-',x,y,z,'bd')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(10)
x=-7.5:0.5:7.5;
y=x;
[x,y]=meshgrid(x,y)
r=sqrt(x.^2+y.^2)+eps
z=sin(r)./r
subplot(1,2,1);
mesh(x,y,z);
title('阔边帽网格线');
subplot(1,2,2);
surf(x,y,z);
title('阔边帽网面线');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
figure(11)
clc
x=-2:2;
y=[3,5,2,4,1;3,4,5,2,1;5,4,3,2,5]
subplot(1,2,1),bar3(x',y',1)
xlabel('因素ABC'),ylabel('x'),zlable('y')
colormap(summer)
subplot(1,2,2)
bar3h(x',y','grouped')
ylabel('x'),zlabel('x')

回帖(38)

wjszhangchao

2012-3-20 10:16:57
很好哦~
举报

…独自等待

2012-6-24 11:46:45
呵呵    再来个三维的
举报

1905701091

2012-6-24 20:50:48
好厉害啊~~弄的真好看{:soso_e142:}{:soso_e177:}
举报

zhengjs

2012-6-24 23:27:17
下载来学习学习
举报

李政霏

2012-11-7 00:37:12
不错不错 谢谢
举报

刘永建

2013-5-31 16:34:24
嗯,看着不错的东西
举报

何文杰

2013-7-25 16:06:23
谢谢楼主的分享,挺有帮助的,对了有没有关于三维曲面的?
举报

00nl

2013-8-14 16:24:04
很好用哈  谢谢
举报

775767511

2014-3-16 10:21:36
好东西,学习学习

举报

changkan123

2014-3-16 10:51:36
下来看看,学习学习,,,
举报

王霏619

2014-3-16 20:20:47
不错很好不错很好
举报

痞子瘾

2014-4-23 13:49:20
赞赞,,,赞mmmmmmmmmmmmmmm
举报

l532423289

2014-5-13 13:59:51
有什么隐藏内容不,啊啊啊啊,大神我爱你
举报

朱绪军

2014-6-28 00:15:26
{:23:}
举报

潘帕斯之恋

2014-7-24 15:55:17

{:1:}
举报

h1654155202.0218

2014-7-25 23:59:19
容老夫试试。。
举报

tommytom

2014-7-27 17:44:10
好好的学习利用
举报

金刚钻哈

2014-7-28 13:41:54
下载来学习学习,小强啊
举报

意难忘wjw

2014-8-5 16:14:58
学习学习,谢谢分享。
举报

更多回帖

发帖
×
20
完善资料,
赚取积分