horner

Horner nested polynomial representation

Syntax

horner(P)

Description

Suppose P is a matrix of symbolic polynomials. horner(P) transforms each element of P into its Horner, or nested, representation.

Examples

Find nested polynomial representation of the polynomial:

syms x
horner(x^3 - 6*x^2 + 11*x - 6)
ans =
x*(x*(x - 6) + 11) - 6

Find nested polynomial representation for the polynomials that form a vector:

syms x y
horner([x^2 + x; y^3 - 2*y])
ans =
   x*(x + 1)
 y*(y^2 - 2)
Was this topic helpful?