With rows have a -1 in its third column? (matlab)

41 Views Asked by At

Let me explain my question with an example.

I have the matrix

$\begin{pmatrix}0 &5 &1 \\ 0&5&-1 \\ 10&-55&2 \\ 4&0&-1 \\ 1&1&1 \\\end{pmatrix}$

and I need to know the number of each row that has a $-1$ in its third column.

How I can do this efficiently?

Thanks!

1

There are 1 best solutions below

0
On

Inspired in the mookid answer, the solution is:

find(A(:,3)==-1)

Thanks!