polyadd: Adding Polynomials

View source: R/polynomials.R

polyaddR Documentation

Adding Polynomials

Description

Add two polynomials given as vectors.

Usage

  polyadd(p, q)

Arguments

p, q

Vectors representing two polynomials.

Details

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

Value

Vector representing a polynomial.

Note

There is no such function in Matlab or Octave.

See Also

conv

Examples

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))

pracma documentation built on Nov. 10, 2023, 1:14 a.m.