I have a matrix A like this:
[0 1 0 2 1 ;0 1 1 2 0 ;0 0 1 2 1 ]
I would like to obtain a vector filled with the column position where there is a same number for a certain condition on the last column…in other words: look in the A(1:4, columns where A(:,5)==1) which correspond to
A(1,1:4) = [0 1 0 2] andA(3,1:4) = [0 0 1 2]
and find the position where there is the same number; save in a vector 1 and 4. thanks!
Best Answer