From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Optimization in matlab
Date: Tue, 14 Apr 2009 10:55:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <gs1q27$ahl$>
References: <>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1239706503 10805 (14 Apr 2009 10:55:03 GMT)
NNTP-Posting-Date: Tue, 14 Apr 2009 10:55:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:532562

zingas <> wrote in message <>...
> Hi
> I want to solve the following optimization problem in matlab
> Minimize[(g1c11+g2c21+a1)^2+(g1c12+g2c22+a2)^2+(g1c13+g2c23+a3)^2+
> (g1c14+g2c24+a4)^2+(g1C15+g2c25+a5)^2+(g1c16+g2c26+a6)^2]
> subject to
> g1^2 +g2^2=>0
> can anybody tell me which function should i use
> Regards

  Letting c be the 2 x 6 matrix of c_ij values and a be the 1 x 6 row vector of a_i values, this is a problem for matlab's matrix forward division operator ('/'):

 g = -a/c;

It finds least square solutions in cases like this where there are more equations to satisfy than unknowns.  You can then evaluate


to get the minimum value of the given expression.

  If by "g1^2+g2^2=>0" you mean "g1^2+g2^2 is greater than or equal to zero", and if g1 and g2 are to be real, I don't understand why you regard that as a condition.  It is true of all reals.

Roger Stafford