Expressing polynomial including a indefinite parameter
Show older comments
Hi All,
I know that the expression p=[1 -4 2] corresponds to p(x) = x^2 - 4x + 2.
I want to express p(x) = a*x^2 - 4x + 2-a
I would appreciate it if you told me how to do that.
Bests,
Cagdas
Accepted Answer
More Answers (1)
Possibly you mean that you want a coefficient vector as the output, rather than a polynomial in functional form.
syms a x
P = 2*a*x^2 - 4*x + 2-a
p=subs(P,x,1)
coefficients = sym2poly(p)
3 Comments
Cagas Akalin
on 21 Oct 2021
Cagas Akalin
on 21 Oct 2021
Yes, what I was trying to implement was exactly that you guessed.
I'm glad we converged, but please Accept-click the answer to indicate that your question was resolved.
Since my question covers an different topic in the bigger picture I will pose it in an another question page.
Yes, by all means.
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!