Hello,
I am trying to identify if a given function is polynomial or not and if it is polynomial what the coefficients are. For example;
sym F xF= 5*x^5+cos(x)*x^2+1 % This is not polynomial because of cos(x) and I want to identify that.
[c,t] = coeffs(F);PolyCoef = sym2poly(F);c =[ 5, 1, 1] % no cos(x) is given in here
>> tt =[ [x^5, 1], [x^2, x], [1, 1]] % no cos (x) is given in here
and sym2poly will give error. I am okay with the error as long as it does not stop the program and tell me that input function is not polynomial.
Thanks for the help.
Best Answer