From: David Doria on 17 Oct 2009 11:47 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 17 Oct 2009 14:47 "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 17 Oct 2009 15:09 "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 19 Oct 2009 08:54 > > 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!
|
Pages: 1 Prev: help, need some advice Next: code for real DFT (without fft)? |