Thread Subject: blank ezplot?

Subject: blank ezplot?

From: David Doria

Date: 30 Oct, 2009 16:10:19

Message: 1 of 3

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

Subject: blank ezplot?

From: David Doria

Date: 2 Nov, 2009 14:28:14

Message: 2 of 3

"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

Subject: blank ezplot?

From: Nasser M. Abbasi

Date: 2 Nov, 2009 22:25:58

Message: 3 of 3


"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

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com