How to find which postions in a vector has negative values and output them?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sairohith mudduluru
le 17 Fév 2018
Commenté : Stephen23
le 19 Fév 2018
i have a vector and need to find the postions which has negative values
0 commentaires
Réponse acceptée
Plus de réponses (1)
Stephen23
le 17 Fév 2018
find is not required, logical indexing is simpler and more efficient:
B = A(A<0)
2 commentaires
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!