How can I use "OR" in this situation? I want it to show if x==2 or d~=0

1 次查看(过去 30 天)
if x==2
disp('Given value is a prime!')
elseif d~=0
disp('Given value is a prime!')
end

采纳的回答

jean claude
jean claude 2017-10-5
编辑:jean claude 2017-10-5
if x==2 || d~=0
disp('Given value is a prime!')
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Discrete Math 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by