ts
xsol = fminsearchcon(rosen,[3 3],[2 2])

%% Only upper bound constraints
xsol = fminsearchcon(rosen,[-5 -5],[],[0 0])

%% Dual constraints
xsol = fminsearchcon(rosen,[2.5 2.5],[2 2],[3 3])

%% Mixed constraints
xsol = fminsearchcon(rosen,[0 0],[2 -inf],[inf 3])

%% Fix a variable as constant, x(2) == 3
fminsearchcon(rosen,[3 3],[-inf 3],[inf,3])

%% Linear inequality, x(1) + x(2) <= 1
fminsearchcon(rosen,[0 0],[],[],[1 1],1)

%% Nonlinear inequality, norm(x) <= 1
fminsearchcon(rosen,[0 0],[],[],[],[],@(x