Problem 45217. Find a common vertex
First input is T, a triplet list of indices. Second input is i, a single index (positive integer). The goal of this function is to find and return the indices of the rows in the list which contain this particular index. Output format is indifferently a column or a row vector.
For example if inputs are
T = [1 2 3;...
1 3 4;...
1 4 2;...
2 3 4]
and
i = 2
the output is the vector
row_idx = [1 3 4]
since 2 is contained in rows number 1, 3, and 4 of T. If the index is not in the list, the function must of course return the empty set. Each index is at most contained once per row / triplet.
See also
Solution Stats
Problem Comments
-
1 Comment
Nicolas Douillet
on 1 Dec 2019
Info : T is actually a triangulation -list of triangles-, in which each index corresponding to the row index of a vertex in another list -a vertices list-, it is a widely used technique used to store and write triangular meshes in mesh processing. Here below the example is a tetrahedron -4 facets-.
Solution Comments
Show commentsProblem Recent Solvers42
Suggested Problems
-
Find the alphabetic word product
3453 Solvers
-
983 Solvers
-
Join Strings with Multiple Different Delimiters
219 Solvers
-
Replace pattern 0 1 0 and 1 0 1
157 Solvers
-
Check that number is whole number
5151 Solvers
More from this Author42
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!