Learn R Programming

pracma (version 1.1.6)

polypow: Polynomial Powers

Description

Power of a polynomial.

Usage

polypow(p, n)

Arguments

p
vector representing a polynomial.
n
positive integer, the exponent.

Value

  • Vector representing a polynomial.

Details

Uses polymul to multiply the polynomial p n times with itself.

See Also

polymul

Examples

Run this code
polypow(c(1, -1), 6)             #=> (x - 1)^6 = (1  -6  15 -20  15  -6   1)
polypow(c(1, 1, 1, 1, 1, 1), 2)  # 1 2 3 4 5 6 5 4 3 2 1

Run the code above in your browser using DataLab