What is the best way to execute 2 if conditions in MATLAB
6 ビュー (過去 30 日間)
古いコメントを表示
assume w=[1 2 2 2]
q=[2 1 1 1]
if w(i)==1
do somehing
else
look to q(i)
if q(i)==1
do some thing
else
do somthing
end
end
0 件のコメント
採用された回答
その他の回答 (1 件)
Walter Roberson
2014 年 4 月 30 日
if w(i) == 1
do somehing
elseif q(i) == 1
do some thing
else
do somthing
end
2 件のコメント
José-Luis
2014 年 5 月 1 日
It will check nothing. It will run that bit only if any of the first two conditions are not satisfied.
参考
カテゴリ
Help Center および File Exchange で Octave についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!