Symbolic Math Toolbox | Search  Help Desk | |
sym2poly | Examples | See Also |
Symbolic-to-numeric polynomial conversion.
c = sym2poly(s)
sym2poly
returns a row vector containing the numeric coefficients of a symbolic polynomial. The coefficients are ordered in descending powers of the polynomial's independent variable. In other words, the vector's first entry contains the coefficient of the polynomial's highest term; the second entry, the coefficient of the second highest term; and so on.
The commands
returnsyms x u v;
sym2poly(x^3 - 2*x - 5)
1 0 -2 -5while
sym2poly(u^4 - 3 + 5*u^2)
returns
1 0 5 0 -3and
sym2poly(sin(pi/6)*v + exp(1)*v^2)
returns
2.7183 0.5000 0
poly2sym
polyval
in the online MATLAB Function Reference