how to write or condition in if statement matlab?
이전 댓글 표시
채택된 답변
추가 답변 (1개)
Shwetank Shrey
2019년 6월 21일
Check out the documentation:
if (j == i) || (flag(j) == 1)
% do something
end
댓글 수: 6
Sultan Mehmood
2019년 6월 21일
madhan ravi
2019년 6월 21일
You need to explain what is your desired result and what you’re trying to do.
Shwetank Shrey
2019년 6월 21일
You would have gotten this when i and/or j are arrays.
if all(j == i) || (flag(j) == 1)
% do something
end
If this still does not work, flag(j) might be returning an array too and you can add an all statement for that too.
Documentation for all : https://www.mathworks.com/help/matlab/ref/all.html
Sultan Mehmood
2019년 6월 21일
madhan ravi
2019년 6월 21일
What is i here , loop iterator?
Sultan Mehmood
2019년 6월 21일
카테고리
도움말 센터 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!