Azzera filtri
Azzera filtri

check if two variables are not equal to zero.

6 visualizzazioni (ultimi 30 giorni)
I have the vector e.g
A=10
B=4
C=0
D=4
V = [A,B,C,D]
How would I check if more than two values equal zero.

Risposta accettata

aneps
aneps il 21 Mag 2014
Modificato: aneps il 21 Mag 2014
ind=find(V==0)
size(ind)
OR
sum(V(:)==0) %this will give the number of zeros

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements 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!

Translated by