Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

how can I extract the coefficients in matlab of polynomials?

the problem is the next one.

syms x u;

A=5*x^5*u^3 + 4*x^4*u^2 +3*u;

I need the coefficients. Is there a function that extracts the coefficients.

2 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    I cant think of a short way, buy if you really want to you could convert the sym function to a string using char(symFunction)

    then use a series of string searches to find the correct coeff.

  • Anonymous
    5 years ago

    the easy way is to do polyfit. use help or doc to find how it works another option: u can make a least squares algoritm to do it.... it should be less than 15-20 lines....

Still have questions? Get your answers by asking now.