Extract vector of all numeric coefficients, including zeros, from symbolic polynomial
c = sym2poly(p)
sym2poly returns coefficients in order
of descending powers of the polynomial variable. If , then
c = sym2poly(p) returns
= [c1 c2 ... cn].
Create row vectors of coefficients of symbolic polynomials.
Extract integer coefficients of a symbolic polynomial into a numeric row vector.
syms x c = sym2poly(x^3 - 2*x - 5)
c = 1 0 -2 -5
Extract rational and integer coefficients of a symbolic polynomial
into a vector. Because
sym2poly returns numeric
double-precision results, it approximates exact rational coefficients
with double-precision numbers.
c = sym2poly(1/2*x^3 - 2/3*x - 5)
c = 0.5000 0 -0.6667 -5.0000