Effacer les filtres
Effacer les filtres

How to input the following optimization into matlab so that can be sovled?! [URGENT]

2 vues (au cours des 30 derniers jours)
Ka Chung Cheng
Ka Chung Cheng le 31 Juil 2015
Commenté : Walter Roberson le 4 Août 2015
I have the following min square opt with a bit complicated equation to put in. I don't know the mathematical induction/function that can solve that properly, pls help.
min Σ ((a-b)^2) s.t. c>0
where b=inv(d*e)*(inv(f*e)+(g'*inv(c)*g))*(inv(f*e))*h+g'*inv(c)*h)
p.s. where all variable except f are all matrix p.s. I got stuck as I want to solve c but cannot make it into the equation. Please shed some light, thanks.
Greg
  2 commentaires
Adam
Adam le 31 Juil 2015
Why is your question more URGENT than every other question here? Everyone's question is urgent to them. It isn't helpful to put it in the title.

Connectez-vous pour commenter.

Réponses (1)

Nick Hobbs
Nick Hobbs le 4 Août 2015
One way to input a minimization problem into MATLAB is with the function fmincon. 'fmincon' is used to minimize a function with a set of constraints. For your equation, the first step would be to define all of your other variables (a, b, d, e, f, and g).
Second, define an anonymous function based on your equation which should look like the following.
functionToOptimize = @(c) a - (inv(d*e)*(inv(f*e)+(g'*inv(c)*g))*(inv(f*e))*h+g'*inv(c)*h);
Then your call to 'fmincon' should look like the following.
fmincon(myFunctionToOptimize, 0, [], [], [], [], 0, Inf)
This statement says you are going to ignore a few of the constraints 'fmincon' can provide, and simply bound it over [0, Inf) with your initial guess as 0.
The documentation for 'fmincon' also includes additional examples.

Community Treasure Hunt

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

Start Hunting!

Translated by