How to get row index of certain values in a vector
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Daniel
il 28 Dic 2013
Commentato: Image Analyst
il 29 Lug 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 Commenti
Risposta accettata
Image Analyst
il 28 Dic 2013
Use find() instead:
rows = find(obj.GanttM(:,2)==i);
1 Commento
Image Analyst
il 29 Lug 2018
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!