www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/FindPartialFractionExpansionExample.m
%% Find Partial Fraction Expansion with Real Roots % Find the partial fraction expansion of the following ratio of polynomials % _F_(_s_) using |residue| % % $$F(s)=\frac{b(s)}{a(s)}=\frac{-4s+8}{s^2+6s+8}.$$ % % Copyright 2015 The MathWorks, Inc. b = [-4 8]; a = [1 6 8]; [r,p,k] = residue(b,a) %% % This represents the partial fraction expansion % % $$\frac{-4s+8}{s^2+6s+8}=\frac{-12}{s+4}+\frac{8}{s+2}.$$ % % Convert the partial fraction expansion back to polynomial coefficients % using |residue|. % [b,a] = residue(r,p,k) %% % This result represents the original fraction _F_(_s_).