Path: news.mathworks.com!not-for-mail 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$1@fred.mathworks.com> References: <f2110a9d-0c0c-4939-9aae-4b4dcb282163@e18g2000yqo.googlegroups.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-03-blr.mathworks.com Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1239706503 10805 172.30.248.38 (14 Apr 2009 10:55:03 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Tue, 14 Apr 2009 10:55:03 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1187260 Xref: news.mathworks.com comp.soft-sys.matlab:532562 zingas <shammashahbaz@gmail.com> wrote in message <f2110a9d-0c0c-4939-9aae-4b4dcb282163@e18g2000yqo.googlegroups.com>... > 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 sum((g*c+a).^2) 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