Thread Subject: Ezplot constants?

Subject: Ezplot constants?

From: David Doria

Date: 17 Oct, 2009 15:47:03

Message: 1 of 4

I want to plot some quadratic functions with varying coefficients, for example:

syms x
syms y
ezplot('2*x^2 + 3*y^2 = 1')

but I want to iterate/vary the '2' and '3' in that expression, something like
a = 2
b = 3
ezplot('a*x^2 + b*y^2 = 1')

but of course a and b aren't recognized inside the ' ' .

How should I do this?

Thanks,

Dave

Subject: Ezplot constants?

From: Nasser M. Abbasi

Date: 17 Oct, 2009 18:47:03

Message: 2 of 4


"David Doria" <daviddoria@gmail.com> wrote in message
news:hbcotn$e16$1@fred.mathworks.com...
>I want to plot some quadratic functions with varying coefficients, for
>example:
>
> syms x
> syms y
> ezplot('2*x^2 + 3*y^2 = 1')
>
> but I want to iterate/vary the '2' and '3' in that expression, something
> like
> a = 2
> b = 3
> ezplot('a*x^2 + b*y^2 = 1')
>
> but of course a and b aren't recognized inside the ' ' .
>
> How should I do this?
>
> Thanks,
>
> Dave

a = 10
b = 11
ezplot(subs('a*x^2 + b*y^2 = 1'))

--Nasser

Subject: Ezplot constants?

From: Steven Lord

Date: 17 Oct, 2009 19:09:07

Message: 3 of 4


"Nasser M. Abbasi" <nma@12000.org> wrote in message
news:BioCm.23531$cL1.21749@newsfe20.iad...
>
> "David Doria" <daviddoria@gmail.com> wrote in message
> news:hbcotn$e16$1@fred.mathworks.com...
>>I want to plot some quadratic functions with varying coefficients, for
>>example:
>>
>> syms x
>> syms y
>> ezplot('2*x^2 + 3*y^2 = 1')
>>
>> but I want to iterate/vary the '2' and '3' in that expression, something
>> like
>> a = 2
>> b = 3
>> ezplot('a*x^2 + b*y^2 = 1')
>>
>> but of course a and b aren't recognized inside the ' ' .
>>
>> How should I do this?
>>
>> Thanks,
>>
>> Dave
>
> a = 10
> b = 11
> ezplot(subs('a*x^2 + b*y^2 = 1'))

Another alternative:

a = 10;
b = 11;
ezplot(a*x^2+b*y^2-1)

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: Ezplot constants?

From: David Doria

Date: 19 Oct, 2009 12:54:02

Message: 4 of 4

> > a = 10
> > b = 11
> > ezplot(subs('a*x^2 + b*y^2 = 1'))
>
> Another alternative:
>
> a = 10;
> b = 11;
> ezplot(a*x^2+b*y^2-1)
>
> --
> Steve Lord

Great - thanks all!

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