>> x=[1,2;1,2]' x = 1 1 2 2 >> y=[3,4;3,2]' y = 3 3 4 2 >> h=plot(x,y) h = 3.0066 101.0060 >> set(h(2),'marker','o','markeredgecolor','r') >> clear >> load Tapir >> whos Name Size Bytes Class tri 1822x3 43728 double array x 1024x1 8192 double array y 1024x1 8192 double array Grand total is 7514 elements using 60112 bytes >> h=trimesh(tri,x,y,0*y); >> clf >> h=trimesh(tri,x,y,0*y); >> view(2) >> X=[tri(x(:,1)),tri(x(:,2)),tri(x(:,3))]; Warning: Subscript indices must be integer values. ??? Index into matrix is negative or zero. See release notes on changes to logical indices. >> X=[x(tri(:,1)),x(tri(:,2)),x(tri(:,3))]; >> Y=[y(tri(:,1)),y(tri(:,2)),y(tri(:,3))]; >> whos Name Size Bytes Class X 1822x3 43728 double array Y 1822x3 43728 double array h 1x1 8 double array tri 1822x3 43728 double array x 1024x1 8192 double array y 1024x1 8192 double array Grand total is 18447 elements using 147576 bytes >> h=patch(X,Y,'c') h = 3.0074 >> h=patch(X',Y','c') h = 3.0076 >> [X,Y,Z]=peaks; >> surf(X,Y,Z);hold on >> close >> surf(X,Y,Z);hold on >> z=interp2(X,Y,Z,x,y); >> whos x y z Name Size Bytes Class x 1024x1 8192 double array y 1024x1 8192 double array z 1024x1 8192 double array Grand total is 3072 elements using 24576 bytes >> clf >> h=trimesh(tri,x,y,z); >> set(h,'facecolor','k') >> hold on >> surf(X,Y,0.8*Z);hold on >> clear >> v=[1 3 4]'; >> col=[0.4 0.4 0.4; 0.8 0 0; 1 1 0]; >> map=interp1(v,col,linspace(1,4,64)','cubic'); >> max(map) ans = 1.0000 1.0000 0.4000 >> min(map) ans = 0.4000 0 0 >> peaks 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) >> colormap(map);colorbar >> figure >> plot(v,col,'o') >> hold on >> plot(linspace(1,4,64),map) >> map=interp1(v,col,linspace(1,4,64)','spline'); >> plot(linspace(1,4,64),map,':') >> clear >> >> load GOMtopex >> whos Name Size Bytes Class C 326x256 667648 double array Z 326x256 667648 double array Z2 326x256 667648 double array map 513x3 12312 double array x 256x1 2048 double array y 326x1 2608 double array Grand total is 252489 elements using 2019912 bytes >> surface(x,y,Z) >> clf >> surf(x,y,Z);shading('interp') >> I=find(Z>0); >> plot(Z(I),Z2(I),'.') >> Z2(I)=interp1([0, max(Z(:))]',[0 5]',Z(I)); >> max(Z2) >> max(Z2(:)) ans = 5 >> surf(x,y,Z2);shading('interp') >> colormap(map) >> plot(Z2(:),C(:),'.') >> h=surf(x,y,Z2,C);shading('interp') >> colormap(map) >> caxis ans = -0.8750 1.4810 >> caxis([-1 1]) >> set(gca,'zlim',[-500 10],'xlim',[-71.62 -64.843]); >> set(gca,'ylim',[39 45.7616]) >> view([0 78]) >> lighting phong >> set(h,'backfacelighting','lit') >> camlight(0,180) >> l=light('style','local','position',[-220 200 100]); >> material dull