Learn R Programming

pracma (version 0.3-0)

polycnv: Multiplying Polynomials

Description

Multiply two polynomials given as vectors.

Usage

polycnv(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
polycnv(c(1, 1, 1), c(0, 1, 1, 1))  #=> 1 2 3 2 1

Run the code above in your browser using DataLab