function A=tripletrialfunc(x,y,z) %Assume vector x and scalars y and z % %See if (x,y,z) is in the correct region. If not, return 0. N=length(x); for j=1:N flag=0; if x(j)<=2 & x(j)>=-2 if y>=x(j)^2 & y<=4 if abs(z)<=sqrt(y-x(j)^2) flag=1; end end end if flag==0 A(j)=0; else A(j)=sqrt(x(j).^2+z.^2); end end