check if two variables are not equal to zero.

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.

 Akzeptierte Antwort

aneps
aneps am 21 Mai 2014
Bearbeitet: aneps am 21 Mai 2014

0 Stimmen

ind=find(V==0)
size(ind)
OR
sum(V(:)==0) %this will give the number of zeros

Weitere Antworten (0)

Kategorien

Mehr zu Nonlinear Analysis finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 21 Mai 2014

Bearbeitet:

am 21 Mai 2014

Community Treasure Hunt

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

Start Hunting!

Translated by