From: David Doria on
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
From: Nasser M. Abbasi on

"David Doria" <daviddoria(a)gmail.com> wrote in message
news:hbcotn$e16$1(a)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


From: Steven Lord on

"Nasser M. Abbasi" <nma(a)12000.org> wrote in message
news:BioCm.23531$cL1.21749(a)newsfe20.iad...
>
> "David Doria" <daviddoria(a)gmail.com> wrote in message
> news:hbcotn$e16$1(a)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(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: David Doria on
> > 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!