MATLAB: Finding location of logical 1 row wise by column

findlocationlogical?MATLAB

Hi, I have a 8 x 621 logical and I would like to extract the row location of the logical 1 by columns i.e the result should be ans = [ 5 8 3 8 ….]
How may I do that?
Thank you!

Best Answer

[idr,~] = find(yourMatrix)