Function: poly2sym (c)
Function: poly2sym (c, x)

Create a symbolic polynomial expression from coefficients.

If x is not specified, the free variable is set to sym('x'). c may be a vector of doubles or syms. It can also be a cell array vector. x may be a symbolic expression or something that converts to one. The coefficients correspond to decreasing exponent of the free variable.

Example:

x = sym ('x');
y = sym ('y');
poly2sym ([2 5])
  ⇒ (sym) 2⋅x + 5
poly2sym ({2*y 5 -3}, x)
  ⇒ (sym)
         2
      2⋅x ⋅y + 5⋅x - 3

See also: @sym/sym2poly, polyval, roots.

Package: symbolic