MATLAB: How Can I find the Coefficients of a Polynomials by equating Coefficients Method

equating coefficientsMATLABpolynomials

Hi guys, I have 2 polynomials, one with known coefficients and one with unknown coefficients. Is there any way in Matlab that I can find the unknown coefficients by equating of coefficients of the like power? For instance, P1=2*s^2+1 and P2=a*s^2+b*s+c, to make P1=P2 we will have a=2,b=0 and c=1. Thanks in advance for the help. Cheers,

Best Answer

If you have a bunch of (s,P1) pairs (at least 3) then you can train a polynomial with polyfit (does a least squares) and it will tell you the best values of a, b, and c to fit your training data. If that what you mean? If not, explain why not.