function [c,ceq] = confun2(invec) x = invec(1); y = invec(2); z = invec(3); c = 0; ceq = (x-3)^2 + (y-4)^2 + (z-5)^2 - 4;