If-Else Statements

 
if x<0
    f = 1-x
elseif x<10
    f = 2*x
else
    f = 0.5*x
end