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!

 Akzeptierte Antwort

Cameron B
Cameron B am 18 Jan. 2020

0 Stimmen

if x - y > 10
disp(greater than 10)
else
disp(less than or equal to 10)
end

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 18 Jan. 2020

Kommentiert:

am 19 Jan. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by