Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Polynomials and Linear Change of Variable
Date: Tue, 14 Feb 2012 19:26:50 -0600
Organization: Aioe.org NNTP Server
Lines: 32
Message-ID: <jhf1kv$e8g$1@speranza.aioe.org>
References: <54339d1a-198a-44dc-8608-2ebd8818c386@dq9g2000vbb.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: sNVsKVV0CtTJ0mbC0Ebx8A.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1
X-Notice: Filtered by postfilter v. 0.8.2
Xref: news.mathworks.com comp.soft-sys.matlab:757676

On 2/14/2012 4:29 PM, Bill Woessner wrote:
> I have a polynomial, represented as a vector.  So px = [3 2 1]
> corresponds to p(x) = 3x^2 + 2x + 1.  I would like to apply a linear
> change of variable, say, y = 4x + 5.  Is there an easy way to get
> Matlab to apply the change of variable for me and compute the new
> coefficients?  In this case, I would expected to get back p(y) = 48x^2
> + 128x + 86 or py = [48 128 86].  I can think of a couple brute force
> ways to do this involving conv() or pascal().  But I'm hoping there's
> a fast and easy way to accomplish this.
>
> Thanks in advance,
> Bill

for these things, might be easier to use symbolic tools

--------------------------
EDU>> syms x y
p=3*x^2+2*x+1;
p=expand(subs(p,x,4*x + 5))
coeff=sym2poly(p)
-----------------------
p =
  
48*x^2 + 128*x + 86
  

coeff =

     48   128    86


--Nasser