If we do the following,
function [z] = a(x,y)
syms x y
If I do the following code,
if x>5
z=x+y
else
z=x-y
end
end
then I hope to have something like (as in Mathematica)
z=IF[x>5,x+y,x-y]
I do not insist on having the exact same code as above. I am flexible. I just want to have "just one line" which expresses how input of function results in output when there are if in the code.
Is this possible?