Partial Fraction Expansion in MATLAB
By Emma Johnson •
$\begingroup$
I am to use MATLAB to find the partial fraction expansion of the following function. Can this be done in that format or do I have to manipulate the function?
Note: This must be done using pure MATLAB only. No add-ons or anything like that. Not even Math Toolbox.
1 Answer
$\begingroup$The matlab function residue does the job. For multiplication of the polynomial roots to convert to standard form use conv:
b = 1e4*conv( [1 5], [1 70] );
a = conv( [1 0], conv([1 45], conv([1 55], conv([1 7 110],[1 6 95]) ) ) );
[r, p, k] = residue(b,a);with r, p and k containing the partial fraction decomposition:
$\frac{b(s)}{a(s)} = k + \sum_i \frac{r_i}{s - p_i}$
check also documentation of the residue function. It is part of the base package and does not need toolboxes.
$\endgroup$ 3