Symbolic Math Toolbox | ![]() ![]() |
Polynomial coefficient vector to symbolic polynomial
Syntax
Description
r = poly2sym(c)
returns a symbolic representation of the polynomial whose coefficients are in the numeric vector c
. The default symbolic variable is x
. The variable v
can be specified as a second input argument. If c = [c1 c2 ... cn]
, r=poly2sym(c)
has the form
poly2sym
uses sym
's default (rational) conversion mode to convert the numeric coefficients to symbolic constants. This mode expresses the symbolic coefficient approximately as a ratio of integers, if sym
can find a simple ratio that approximates the numeric value, otherwise as an integer multiplied by a power of 2.
If x
has a numeric value and sym
expresses the elements of c
exactly, eval(poly2sym(c))
returns the same value as polyval(c,x)
.
Examples
poly2sym([.694228, .333, 6.2832])
returns
poly2sym([1 0 1 -1 2], y)
returns
See Also
sym
, sym2poly
polyval
in the online MATLAB Function Reference
![]() | poly | pretty | ![]() |