作业帮 > 综合 > 作业

帮忙用matlab画等值线图

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/15 14:52:36
帮忙用matlab画等值线图
已知各点坐标与数值如下
(1,1)5.14
(1,2)9.56
(1,3)8.66
(2,1)12.55
(2,2)10.51
(2,3)2.7
(3,1)22.03
(3,2)22.97
(3,3)32.94
(4,2)55.58
(4,3)24.55
需要画出平滑的等值线图,各等值线之间间距相等,并用不同深浅颜色表示相邻两等值线之间区域.
clc;clear
A=[...
1 1 5.14
1 2 9.56
1 3 8.66
2 1 12.55
2 2 10.51
2 3 2.7
3 1 22.03
3 2 22.97
3 3 32.94
4 2 55.58
4 3 24.55];
[x,y]=meshgrid(1:0.1:4,1:0.1:3);
z=griddata(A(:,1),A(:,2),A(:,3),x,y,'v4');
subplot(1,2,1)%figure(1)
meshc(x,y,z)
subplot(1,2,2)%figure(2)
[c,h] =contour(x,y,z);
clabel(c,h)
xlabel('x');ylabel('y')
图形见我的博客:
http://hi.baidu.com/chemical%5Fengineering/album/item/fddb5982f70f34860df4d2a8.html