%This code creates a multivariate function of your choosing which can be
%passed into other functions.  The function below is of the form
%f(x1,x2).  Written by Philip Shaw, Fordham University, 2018.
function[fx]=myfunps2(x)
if ((x(1)<=2)&(x(2)<=2))
    fx=4*x(1)+3*x(2);
elseif ((x(1)>2)&(x(2)>2))
    fx=x(1)^2+x(2)^2;
else
    fx=0;
end