What is the best way to execute 2 if conditions in MATLAB
이전 댓글 표시
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
채택된 답변
추가 답변 (1개)
Walter Roberson
2014년 4월 30일
if w(i) == 1
do somehing
elseif q(i) == 1
do some thing
else
do somthing
end
댓글 수: 2
yousef Yousef
2014년 4월 30일
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.
카테고리
도움말 센터 및 File Exchange에서 Octave에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!