Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,686
Registered: 2/7/05
Re: get coefficients from a symbolic polynomial
Posted: Jan 5, 2013 5:02 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/5/2013 3:49 PM, Qiming wrote:
>

> 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
>


why is it so hard for someone to just make a simple example to explain
what they mean? one spends so much time writing words, instead of
making a simple code example.

If you mean this:

EDU>> syms x a b
EDU>> y=a*x^2+b*x+1;

then do

EDU>> coeffs(y,x)
[ 1, b, a]

If you still mean something else, then make up a small example. Do not
explain in words, show a small Matlab example of the input polynomial
itself. complete and self contained example. I am sure you can make
one up if you try.

--Nasser







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.