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

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

 Accepted 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)

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!