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!