Why does the RESIDUE function return incorrect results in MATLAB?

5 Ansichten (letzte 30 Tage)
Why does the RESIDUE function return incorrect results in MATLAB?
The following code provides unexpected results:
a = 0;
b = 1;
[r,p,k] = residue(a,b)
r =
[]
p =
[]
k =
1
In this case, k should be ZERO and not 1.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 27 Jun. 2009
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This is a bug with the RESIDUE function in MATLAB that our development staff is currently investigating.
If you have The Signal Processing Toolbox, you can use the RESIDUEZ function to work around this issue. There are no other known workarounds at this time.
  1 Kommentar
Paul
Paul am 9 Okt. 2021
That's not what the outputs of residue mean nor how partial fraction expansion works. The pole at s = 0 is repeated and residue knows that r(2) applies to the repeated pole
num = 1;
den = [1 0 0];
tf(num,den)
ans = 1 --- s^2 Continuous-time transfer function.
[r,p,k] = residue(num,den);
[newnum,newden] = residue(r,p,k);
tf(newnum,newden)
ans = 1 --- s^2 Continuous-time transfer function.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by