How to input the following optimization into matlab so that can be sovled?! [URGENT]
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Adam
2015-7-31
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.
回答(1 个)
Nick Hobbs
2015-8-4
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!