Finding column index of the first instance of 1
Ältere Kommentare anzeigen
I have a logical array like this:

I want to extrat the colum index of the cells where the first instance of 1 is detected. Like this:

For example, you see here that the first two rows show 4, because that is where 1 is first detected.
Akzeptierte Antwort
Weitere Antworten (1)
Jonas
am 2 Mai 2022
0 Stimmen
use the find() function together with a loop over each row
1 Kommentar
Pelajar UM
am 2 Mai 2022
Bearbeitet: Pelajar UM
am 2 Mai 2022
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!