Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: get coefficients from a symbolic polynomial
Replies: 6   Last Post: Jan 5, 2013 5:49 PM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Qiming Posts: 10 Registered: 12/21/12
Re: get coefficients from a symbolic polynomial
Posted: Jan 5, 2013 4:49 PM
 Plain Text Reply

"Nasser M. Abbasi" wrote in message <kca2be\$9dd\$2@speranza.aioe.org>...
> On 1/5/2013 9:49 AM, Qiming wrote:
>

> >
> > Note that the entire polynomial is symbolic, that is, even the coefficients 0, 1, 2, 3
> >are in symbolic form instead of numbers, so I cannot use 'sym2poly(y)' to get the coefficients.

>
> Can you show why you can't? i.e. show what you tried, and the error you get, as it works for me:
>
> EDU>> syms x
> EDU>> y=3*x^3 + 2*x^2 + x;
> EDU>> sym2poly(y)
>
> ans =
>
> 3 2 1 0
>
>
> --Nasser

Hi Nasser:

Thanks for your reply.

In your case, actually only 'x' is symbolic, the coefficients 0,1,2,3 are already in numerical form. But my question is: what if 0,1,2,3 are all in symbolic forms?

I only give a simple example so that you might think why can't I directly put 0,1,2,3 in the expression. However, in my real application, those coefficients long and complicated and are generated by MATLAB symbolic tool box. I just want to "retrieve" those coefficients for my future use. Of course I can check those coefficients from the command window, but I don't want to put them back in my code by hand.

Qiming

Date Subject Author
1/5/13 Qiming
1/5/13 Nasser Abbasi
1/5/13 Nasser Abbasi
1/5/13 Qiming
1/5/13 Nasser Abbasi
1/5/13 Qiming
1/5/13 Qiming

© The Math Forum at NCTM 1994-2016. All Rights Reserved.