MATLAB: How to find an element in a matrix that meets a condition then call its entire row

find

I'm using the delaunayTriangulation function and I'm trying to get all of the neighboring vertices(which should be the row of DT.ConnectivityList) of a specific vertex. I know how to use find but I'm unclear on how to find out what row that element is in.

Best Answer

Use find with two output arguments:
N = ...;
[r,c] = find(DT==N);
This is the easiest way, especially if you don’t know the column the value you want is in. Here, ‘r’ is the row and ‘c’ the column of every occurrence of ‘N’.