Learn R Programming

pracma (version 1.4.5)

polyadd: Adding Polynomials

Description

Add two polynomials given as vectors.

Usage

polyadd(p, q)

Arguments

p, q
Vectors representing two polynomials.

Value

  • Vector representing a polynomial.

Details

Polynomial addition realized simply by multiplying and summing up all the coefficients after extending vectors to the same length.

See Also

conv

Examples

Run this code
polyadd(c(1, 1, 1), 1)
polyadd(c(1, 1, 1), c(0, 0, 1))
polyadd(c(-0.5, 1, -1), c(0.5, 0, 1))

Run the code above in your browser using DataLab