I have a matrix, that I want to find a column that has item in row1 == x, and item in row2 == y; What is the fastest way to do this? Thanks, CP
This should work for a given matrix M
and row indices row1
and row2
:
columnIndices = find((M(row1,:) == x) & (M(row2,:) == y));