check if two variables are not equal to zero.

4 vues (au cours des 30 derniers jours)
Giuseppe
Giuseppe le 21 Mai 2014
Modifié(e) : aneps le 21 Mai 2014
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.

Réponse acceptée

aneps
aneps le 21 Mai 2014
Modifié(e) : aneps le 21 Mai 2014
ind=find(V==0)
size(ind)
OR
sum(V(:)==0) %this will give the number of zeros

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by