(在线等)已知一系列散点,用matlab绘制三维图形,并插值
已知一系列散点,坐标(x,y,z)分别为:(3,3,1.5300),(3,27,0.4210),(5,17,0.5980),(9,9,0.5900)(13,25,0.44...
已知一系列散点,坐标(x,y,z)分别为:(3,3,1.5300),(3,27,0.4210),(5,17,0.5980),(9,9,0.5900)(13,25,0.4470),(15,15,0.4200),(17,5,0.3830),(21,21,0.3100)(25,13,0.2830) ,(27,3,0.2820),(27,27,0.1200),求一段matlab程序,用这些散点绘制三维图形,并且用这些点进行插值,谢谢!
展开
展开全部
将数据存在1210.txt记事本下面:
3 3 1.5300
3 27 0.4210
5 17 0.5980
9 9 0.5900
13 25 0.4470
15 15 0.4200
17 5 0.3830
21 21 0.3100
25 13 0.2830
27 3 0.2820
27 27 0.1200
%%%%%%%%%%%%%%%%%%
a=importdata('1210.txt');
x=a(:,1);
y=a(:,2);
z=a(:,3);
xtemp=linspace(min(x),max(x),100);
ytemp=linspace(min(y),max(y),100);
[X,Y]=meshgrid(xtemp,ytemp);
Z=griddata(x,y,z,X,Y);
mesh(X,Y,Z)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询