Clear Filters
Clear Filters

how to write or condition in if statement matlab?

46 views (last 30 days)
if
(j==i) , or (flag(j)==1)

Accepted Answer

Akshay Malav
Akshay Malav on 21 Jun 2019
if (j==i) | (flag(j)==1)
% your code
end

More Answers (1)

Shwetank Shrey
Shwetank Shrey on 21 Jun 2019
Check out the documentation:
if (j == i) || (flag(j) == 1)
% do something
end
  6 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!