%% 3-D Triangulation
% Find neighboring tetrahedra in a 3-D triangulation.
% Create a 3-D triangulation.

load tetmesh
TR = triangulation(tet,X);

%
% Compute the IDs of the neighboring tetrahedra to each element of the triangulation.

N = neighbors(TR);

%
% Display the IDs of the neighbors to the fifth tetrahedron.

N(5,:)

%
% Examine the vertex IDs of the first neighbor.

TR.ConnectivityList(N(1),:)

% Copyright 2012 The MathWorks, Inc.