0

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!

yemino
  • 814

1 Answers1

1

Inspired in the mookid answer, the solution is:

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

Thanks!

yemino
  • 814