R: Adding Polynomials

polyadd {pracma} | R 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))

[Package pracma version 2.0.4 Index]