x greater than y by some value

10 次查看(过去 30 天)
Hi!
I have a problem with the syntax, I want to write an if loop that: if x is greater than y by 10 then .. I only know how to write that x is greater than y and the action, but how to write that is 10 greater?
The solution is probably easy but I have no idea ..
Thank you for your help!

采纳的回答

Cameron B
Cameron B 2020-1-18
if x - y > 10
disp(greater than 10)
else
disp(less than or equal to 10)
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by