How can I use "OR" in this situation? I want it to show if x==2 or d~=0
3 views (last 30 days)
Show older comments
Bror Markus Salmelin
on 5 Oct 2017
Edited: jean claude
on 5 Oct 2017
if x==2
disp('Given value is a prime!')
elseif d~=0
disp('Given value is a prime!')
end
0 Comments
Accepted Answer
jean claude
on 5 Oct 2017
Edited: jean claude
on 5 Oct 2017
if x==2 || d~=0
disp('Given value is a prime!')
end
0 Comments
More Answers (0)
See Also
Categories
Find more on Discrete Math in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!