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.

Expand this

  • 1
    $\begingroup$ Short of writing some code to solve for the coefficients of the partial fraction expansion (essentially collecting terms to construct a system of linear equations, then using Matlab to solve the system), I'm not sure there is a "pure Matlab only" approach. $\endgroup$
    – hardmath
    Sep 23, 2014 at 0:45

1 Answer 1


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.

  • $\begingroup$ I know for sure residue function is for s-domain however if we use it in z-domain it gives our mathematically matched answer but not with z-domain function residuez. Any taker please? $\endgroup$
    – Khaaba
    Oct 28, 2018 at 5:15
  • 1
    $\begingroup$ @Khaaba: residuez computes the partial fraction expansion with respect to variable $z^{-1}$, which is the convention needed in discrete time systems theory. The residue function calculates the partial fraction decomposition in the mathematical sense. It is a matter of convention and residuez can be simulated in terms of residue with some adaption of the input polynomial. $\endgroup$
    – Andreas H.
    Oct 28, 2018 at 14:09
  • $\begingroup$ I got it. I tried myself today morning and what you are saying true. I took time for me understand. Thank you. $\endgroup$
    – Khaaba
    Oct 29, 2018 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .