Contents Previous Next Subchapters

Adding Polynomials
Syntax poladd(pq)
See Also polmul , polval , pol2asc

Description
Returns a column vector that corresponds to the polynomial that is the sum of the polynomials corresponding to the integer, real, double-precision or complex column vectors p and q. If v is a column vector of length n the corresponding polynomial v[x] is
                      1        2              n-1
     v[x] = v  +  v  x  +  v  x   + ... + v  x
             1     2        3              n
The return value has the same type as a binary operation between the type of p and the type of q and its length is the maximum of the lengths of p and q.

Example
If you enter
     p = {1, 2}
     q = {1, 2, 3, 4}
     poladd(p, q)
O-Matrix will respond
     {
     2
     4
     3
     4
     }
Note that if you attempted to evaluate the expression
     p + q
O-Matrix would respond with an error message because the length of p and q are different.