- 积分
 - 38
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2011-8-7
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
 
发表于 2012-9-6 11:35:55
|
显示全部楼层
 
 
 
[x,y]=meshgrid(1:100,1:100);  %生成网格点 
 
z=griddata(data(:,1),data(:,2),data(:,3),x,y,'v4');%你的数据得插值成网格型数据。 
%z=griddata(linspace(min(data(:,1)),max(data(:,1)),200),linspace(min(data(:,2)),max(data(:,2)),200),'v4');% 
 
%z=interp2(data(:,1),data(:,2),data(:,3),x,y); 
%P=peaks(100);P(1:100,1:100)=NaN; % 镂空 
%z=z*sin(z); 
%surfc(P);colormap(summer) 
figure,surf(x,y,z); 
 
%light('position',[50,-10,5]),lighting flat 
%plot3(x,y,z,'b-',x,y,z,'bd') 
%TriScatteredInterp(x,y,z);  
%mesh(x,y,z); 
%interp3(data,3,'spline'); 
%hidden off; 
%hold on pcolor(z);  
%P(0:100,0:100)=NaN*ones(0,100); 
%meshz(P) 
%meshc(x,y,z); 
%meshz(x,y,z); 
%shading interp; 
%grid on; 
title('Three dimension forest'); 
xlabel('X(m)'), ylabel('Y(m)'), zlabel('Z(m)'), 
colormap, colorbar; 
axis([0 100 0 100 0 20]) 
colormap gray; 
hold on; 
shading interp  |   
 
 
 
 |