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

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

% Copyright 2015 The MathWorks, Inc.

[x,y] = meshgrid(1:15,1:15);
tri = delaunay(x,y);
z = peaks(15);
trimesh(tri,x,y,z)
%%
% If the surface is already a triangulation representation, then you can pass the triangulation to |trimesh|:
tr = triangulation(tri,x(:),y(:),z(:));
trimesh(tr)