Dear all; how to check if at least one array in a logical vector is true? for example: A=[0 0 0 1 0 0] and there is at least one ''1'' in this array.
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear all; how to check if at least one array in a logical vector is true? for example: A=[0 0 0 1 0 0] and there is at least one ''1'' in this array.
0 commentaires
Réponses (1)
Azzi Abdelmalek
le 12 Août 2016
Modifié(e) : Azzi Abdelmalek
le 12 Août 2016
A=[0 0 0 1 0 0]
out=any(A)
To check if theye are all equal to 1 use all(A)
0 commentaires
Voir également
Catégories
En savoir plus sur Data Types 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!