First input T is a triangulation (triplet list of indices -positive integers-, each index refering to a vertex number in a corresponding vertices list).
Given a second input t (a certain triangle row index), one would like to query the list L of all its triangle neighbor indices. A triangle is neighbor to another triangle if they share exactly one edge.
For instance if
T = [1 2 4;...
2 3 4;...
5 6 8;...
6 7 8;...
1 2 5;...
2 5 6;...
2 3 6;...
3 6 7;...
3 4 7;...
4 7 8;...
4 1 8;...
1 8 5]
and t = 3, then the function should return
L = [4, 6, 12]'
since rows / (triangles of T) 4, 6, and 12 contain an edge in common with triangle / row 3.edge [6 8] for the first, edge [5 6] for the second, and edge [8 5] for the third.
Hypothesis :
- Since a triangle is not considered neighbor of itself, t should not be part of L.
- Order doesn't matter, but T must be a column vector containing all the neighbor triangle -row- indices (except itself then) once only. No duplicata is admitted.
- Edges are symmetric : [e1, e2] is the same edge as [e2, e1]
- Every indices are positive, distinct integers.
See also

Solution Stats

61 Solutions

28 Solvers

Last Solution submitted on May 24, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers28

Suggested Problems

More from this Author42

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!