[TOC]

deconv

Deconvolution or polynomial division

Usage

[q, r] = deconv(b, a)

💡 When representing a polynomial by a vector p, p(1) and p(end) are the highest and the zeroth order coefficients, respectively.

💡 conv(a,q) + r gives the same vector as b.

Examples

Input
u = 1:5;
v = 1:6;
[q,r] = deconv(u,v)
Output
q =
 0.000

r =
 1.000   2.000   3.000   4.000   5.000
Input
u = 1:7;
v = 1:6;
[q,r] = deconv(u,v)
Output
q =
 1.000   0.000

r =
Columns 1 through 5:
 0.000   0.000   0.000   0.000   0.000
Columns 6 through 7:
 0.000   7.000
Input
u = 1:7;
v = 1:6;
[q,r] = deconv(u,v)
conv(v,q) + r
Output
q =
 1.000   0.000

r =
Columns 1 through 5:
 0.000   0.000   0.000   0.000   0.000
Columns 6 through 7:
 0.000   7.000

ans =
Columns 1 through 5:
 1.000   2.000   3.000   4.000   5.000
Columns 6 through 7:
 6.000   7.000