MATLAB Answers

x greater than y by some value

2 views (last 30 days)
Caroline
Caroline on 18 Jan 2020
Commented: Caroline on 19 Jan 2020
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!

  0 Comments

Sign in to comment.

Accepted Answer

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

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by