画图

x=rand(10,1);
y=rand(10,1);
z=rand(10,1);
stps=0:0.03:1;
[X,Y]=meshgrid(stps);
Z1=griddata(x,y,z,X,Y);
Z2=griddata(x,y,z,X,Y,'cubic');
Z3=griddata(x,y,z,X,Y,'nearest');
Z4=griddata(x,y,z,X,Y,'v4');
subplot(2,2,1);
mesh(X,Y,Z1);
hold on
plot3(x,y,z,'o');
subplot(2 ,2, 2);
mesh(X,Y,Z2);
hold on
plot3(x,y,z,'o');
hold off
subplot(2,2,2);
mesh(X,Y,Z2);
hold on
plot3(x,y,x,'o');
hold off
subplot(2,2,3);
mesh(X,Y,Z3);
hold on
plot3(x,y,z,'o');
hold off
subplot(2,2,4);
mesh(X,Y,Z4);
hold on
plot3(x,y,z,'o');
hold off

posted @ 2016-08-17 19:35  清水谦和  阅读(105)  评论(0编辑  收藏  举报