Learn R Programming

pracma (version 1.1.6)

polymul: Multiplying Polynomials

Description

Multiply two polynomials given as vectors.

Usage

polymul(p, q)

Arguments

p, q
Vectors representing two polynomials.

Value

  • Vector representing a polynomial.

Details

Polynomial multiplication realized simply by multiplying and summing up all the coefficients.

See Also

conv, deconv

Examples

Run this code
# Multiply x^2 + x + 1 with itself
polymul(c(1, 1, 1), c(0, 1, 1, 1))  #=> 1 2 3 2 1

Run the code above in your browser using DataLab