Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe17.iad.POSTED!7564ea0f!not-for-mail
From: "Nasser M. Abbasi" <nma@12000.org>
Newsgroups: comp.soft-sys.matlab
References: <hcf35b$5ce$1@fred.mathworks.com> <hcmq9u$818$1@fred.mathworks.com>
Subject: Re: blank ezplot?
Lines: 58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3598
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-EsetId: 321EA926BF203339655E
X-EsetScannerBuild: 5955
Message-ID: <%%IHm.114$sY5.18@newsfe17.iad>
NNTP-Posting-Host: ncdeodfefpjopplmihjclpliaacepnnh
X-Complaints-To: abuse@charter.net
X-Trace: lohomekffeimhpgdadefjppgkgeilljacfbajdlgkbdpneaancdeodfefpjopplmmgdmmdanmgdmojgmcidmjnphkomhbcecildolkkeocphpjlegdjgmejppndbeibpgemlcloahffblffb
NNTP-Posting-Date: Mon, 02 Nov 2009 22:26:03 UTC
Date: Mon, 2 Nov 2009 16:25:58 -0600
Xref: news.mathworks.com comp.soft-sys.matlab:581921



"David Doria" <daviddoria@gmail.com> wrote in message 
news:hcmq9u$818$1@fred.mathworks.com...
> "David Doria" <daviddoria@gmail.com> wrote in message 
> <hcf35b$5ce$1@fred.mathworks.com>...
>> If I have this function:
>> function PlotPolynomialClassifier(W)
>> syms x;
>> syms y;
>> f = W(1) + W(2) * x + W(3) * y + W(4) * x^2 + W(5) * y^2; %doesn't work
>> %f = W(1) + W(2) * x + W(3) * y + W(4) * x^2; %works
>> ezplot(f);
>>
>> When I call it with this vector:
>> a=[62 -1.8 38 .01 18];
>>
>> it produces an empty plot. I used solve(f,y) =  ((648*x)/5 - 
>> (18*x^2)/25 - 3020)^(1/2)/36 - 19/1 to see if there are any problems with 
>> the function (divide by zero or something like that) but it doesn't look 
>> like it.
>>
>> Does anyone know why this would be producing an empty plot?
>>
>> Thanks,
>>
>> Dave
>


> Any thoughts?
>
> Dave

Because you are telling matlab to plot the function f(x,y)=0. that what 
ezplot does.

When I solved this function for x and y,  I find that f=0 when

x=0.5* (180. - 84.852* sqrt(0.4174526 - *y) * sqrt(2.528 + y) )

And over the default region used which 2pi..2pi, if you evaluate x for 
y=-2Pi..2Pi, you'll get complex numbers for all these values with just 
constant real part and varying complex part.  ezplot has nothing to show for 
this.

May be what you want is to plot is just f(x,y) for different x,y values. use 
ezcontour()

(i substituted your W values already below into f)

syms x y
f= 62 - 1.8*x + 38*y + .01*x^2 + 18*y^2;
ezcontour(f)


--Nasser