Nonlinear optimization is a very difficult problem, so no method is guaranteed to work for every case. For your case, you can solve x(2) analytically from x(1). So you can make it into an unconstrained optimization problem.
func_cstr = @(x) func(x, 4/x);
fminsearch(func_cstr, initial_x1)
If you cant make an explicit relationship between x(1) and x(2), then you can try a penalty method:
pen = 1e5;
constraint = @(x) (x(1)*x(2)-4)
func_cstr = @(x) func(x)+pen*constraint(x)^2;
[x,fval] = fminsearch(func_cstr, initial_x1_and_x2);
There is also a constrained optimization solver fmincon
provided by MATLAB.