From: "Steven_Lord" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: suppose I have an equation x^2+x+y^2+3*y=5*y^2+3*y+3*x*y+5 and I want to find the set of (x,y) that satisfy the equation.
Date: Thu, 12 Aug 2010 10:46:14 -0400
Organization: MathWorks
Lines: 43
Message-ID: <i411fm$4e0$>
References: <i40rce$qur$>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: 1281624374 4544 (12 Aug 2010 14:46:14 GMT)
NNTP-Posting-Date: Thu, 12 Aug 2010 14:46:14 +0000 (UTC)
In-Reply-To: <i40rce$qur$>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: comp.soft-sys.matlab:661427

"Kittithad Wangveerathananon" <> wrote in message 
> Question
> How can i do that?
> I've been trying, solve, explot and subs.
> I can get the graph, but i cannot get the (x,y) pairs that I want.

What, specifically, do you want to obtain?  There are an infinite number of 
(x, y) points that satisfy this equation.  One such pair is approximately 
(3, -2.8615).

> When I use function solve to solve the equation in term of x or y and then 
> substitute the numeric value for one of them to find the other, I got the 
> problem about complex numer. This might be because that numeric value that 
> I substitute is not the number that satisfy the equation, so the program 
> give me the result in complex number.
> Background.
> I need to use the pairs to find the optimal value of my objective 
> function.
> I tried to use the fmincon, but it gave me the optimal value that is not 
> reliable, so i try to do it manually.
> Note that my equality constraint is in the form of the equation in the 
> subject.

Don't do that.  Please put your ENTIRE question in the body of your message, 
for easy quoting.

> I also have a couple of inequality constraints.

If you were just looking to identify the points that satisfy your equation 
graphically, I would use CONTOUR.  Write your equation as z = f(x, y) and 
look at the contour for z = 0.

Steve Lord
comp.soft-sys.matlab (CSSM) FAQ:
To contact Technical Support use the Contact Us link on