Practical 6: Polynomial Functions
Practical 6
Adding and Subtracting
The coefficient arrays of the polynomials can be added and subtracted.
> Exercise: Adding Polynomials with Coefficient Arrays > Add the following polynomial coefficient arrays: p = [3 -4 0 7 -9 3] q = [4 5 -6] p + q > What is the problem here? Re-define q as follows and check whether the addition works as you would expect. q = [0 0 0 4 5 -6] %Now terms with corresponding powers will be added p + q |
![]() |