check if two variables are not equal to zero.

4 ビュー (過去 30 日間)
Giuseppe
Giuseppe 2014 年 5 月 21 日
編集済み: aneps 2014 年 5 月 21 日
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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by