%% Neighbors of All Tetrahedra
% Load a 3-D triangulation and use TriRep to compute the neighbors of all tetrahedra.

load tetmesh
trep = TriRep(tet,X);
nbrs = neighbors(trep);

%
% You can use the output to find the neighbors of any specific tetrahedron in the triangulation. For example, the neighbors of tetrahedron 3 are nbrs(3,:).

nbrs(3,:)

%
% Copyright 2020 The MathWorks, Inc.