How to get row index of certain values in a vector
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Daniel
am 28 Dez. 2013
Kommentiert: Image Analyst
am 29 Jul. 2018
I am looking for a way to extract the row index of certain values from a vector.
I tried with
[ ~ , index ] = max(obj.GanttM(:,2)==i);
This only gives me one index but the number i appears several times. How can I extract all row indeces with one command?
Thank you.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 28 Dez. 2013
Use find() instead:
rows = find(obj.GanttM(:,2)==i);
1 Kommentar
Image Analyst
am 29 Jul. 2018
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!