www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/CreateTriangularSurfacePlotExample.m

    %% Create Triangular Surface Plot
% Create vertex vectors and a face matrix, then create a triangular surface plot.

% Copyright 2015 The MathWorks, Inc.

[x,y] = meshgrid(1:15,1:15);
tri = delaunay(x,y);
z = peaks(15);
trisurf(tri,x,y,z)

%%
% If the surface is in the form of a triangulation representation, you can pass it to |trisurf| alone:
tr = triangulation(tri,x(:),y(:),z(:));
trisurf(tr)