check if two variables are not equal to zero.

6 次查看(过去 30 天)
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.

采纳的回答

aneps
aneps 2014-5-21
编辑:aneps 2014-5-21
ind=find(V==0)
size(ind)
OR
sum(V(:)==0) %this will give the number of zeros

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by