Learn R Programming

pracma (version 1.5.8)

Poly: Define Polynomial by Roots

Description

Define a polynomial by its roots.

Usage

Poly(x)

Arguments

x
vector or square matrix

Value

  • Vector representing a polynomial.

Details

Computes the characteristic polynomial of an (n x n)-Matrix.

If x is a vector, Poly(x) is the vector of coefficients of the polynomial whose roots are the elements of x.

See Also

polyval, roots

Examples

Run this code
Poly(c(1, -1, 1i, -1i))  # Solves x^4 -1 = 0
  # Wilkinson's example:
  roots(Poly(1:20))

Run the code above in your browser using DataLab