Azzera filtri
Azzera filtri

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.

43 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 12 Ago 2016
Modificato: Azzi Abdelmalek il 12 Ago 2016
A=[0 0 0 1 0 0]
out=any(A)
To check if theye are all equal to 1 use all(A)

Categorie

Scopri di più su Programming 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!

Translated by