I am trying to define a function in MATLAB according to the following conditions:
If t<0
f(t,x,y)=t*(x/y)+1.
else
f(t,x,y)=-t*(x/y)+1.
end
I found a way to define a piecewise function in one variable, but here I have three variables. Is there a way to define such a function in MATLAB?