Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to plot(graph) cubic equation?
Date: Tue, 24 Aug 2010 17:19:07 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 26
Message-ID: <i50uub$5ok$1@fred.mathworks.com>
References: <i50sqr$gd6$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1282670347 5908 172.30.248.38 (24 Aug 2010 17:19:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 24 Aug 2010 17:19:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1597503
Xref: news.mathworks.com comp.soft-sys.matlab:664629

"swe lin " <pcgeekservice@gmail.com> wrote in message <i50sqr$gd6$1@fred.mathworks.com>...
> Please point me out how to plot the following equation:
> 
> ( ( 5+ 6*x)/3 )^3  + ((2 - 3*x + 4*y)/2) ^2 =0;
> 
> Thank in advance!

Hi, There are many ways to go about this. You can just plot the function as a surface and just visually see where f(x,y)=0

x = -10:.1:10;
y = -10:.1:10;
[xnew,ynew] = meshgrid(x,y);
 z = ( ( 5+ 6*xnew)/3 ).^3 + ((2 - 3*xnew + 4*ynew)/2).^2;
surf(x,y,z)
 shading interp
 view(-16,12)

You can do it as a 3d contour which makes it a bit more salient where f(x,y)=0

contour3(xnew,ynew,z);

or simply as a filled contour

contourf(xnew,ynew,z); xlabel('X'); ylabel('Y');

Wayne