How to find which postions in a vector has negative values and output them?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
sairohith mudduluru
il 17 Feb 2018
Commentato: Stephen23
il 19 Feb 2018
i have a vector and need to find the postions which has negative values
0 Commenti
Risposta accettata
Più risposte (1)
Stephen23
il 17 Feb 2018
find is not required, logical indexing is simpler and more efficient:
B = A(A<0)
2 Commenti
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!