MATLAB: Is it possible to represent objective function and constraints as matrices while using optimization tool box

constrained non linear minimization

Can the objective function and constraints be represented as matrices similar to the linear programming solver?

Best Answer

linprog() and intlinprog() and quadprog() and lsqlin() and lsqnonneg() are part of the Optimization Toolbox.
However, fminsearch(), fgoalattain(), fmincon(). fminunc(), fseminf(), lsqcurvefit(), lsqnonlin(), fsolve() and fzero() do not accept expressing the function in terms of matrices.
You can write a small anonymous function such as
residue = @(x) sum((M*x(:)).^2)
Related Question