%% 3-D Triangular Mesh
% Create a set of 3-D points. Compute a Delaunay triangulation connectivity matrix using the delaunay function, and plot the mesh.

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

%
% Alternatively, you can create a triangulation object to plot the mesh.

TO = triangulation(T,x(:),y(:),z(:));
trimesh(TO)

% Copyright 2015 The MathWorks, Inc.