Error using built-in residue function

5 visualizzazioni (ultimi 30 giorni)
Upon generating the code below I get an error which points to a line of code within the function .M file:
{START CODE} den1=conv([1 4],[1 4])
den1 =
1 8 16
EDU>> den2=conv([1 4],[1 4])
den2 =
1 8 16
EDU>> den3=conv(den1,den2)
den3 =
1 16 96 256 256
EDU>> den=conv(den3,[1 1])
den =
1 17 112 352 512 256
EDU>> num = [0 5]
num =
0 5
EDU>> [res, pole, rem] = residue(num, den) ??? Error using ==> poly Too many output arguments.
Error in ==> residue at 128 v = poly(p); {END CODE}
Sometimes when I run the code with different vectors stored as "num" & "den" the error points to line 139, which I presume to be a result of the roots its testing for.
I'm running MATLAB R2011a on a Mac OSX 10.8 (Mountain Lion). I've even tested a classmates script .M file, which worked just fine on his computer; however, I ran into the same issue when I ran his script on my machine. Here's that script:
{START CODE} num = [5]; den1 = [1 4]; den2 = [1 4]; d1d2 = conv(den1,den2); den3 = [1,1]; dentotal = conv(d1d2,den3);
[r,p,k]=residue(num,dentotal) {END CODE}
Any ideas? Thanks. Kaleb

Risposta accettata

Walter Roberson
Walter Roberson il 11 Feb 2013
Please use
which -all poly
to find out whether you have a poly.m that is overriding the expected poly function.
  1 Commento
Kaleb Christoffersen
Kaleb Christoffersen il 11 Feb 2013
Modificato: Kaleb Christoffersen il 11 Feb 2013
AMAZING! Thank you so much for that tiny but oh so useful bit of information. That was definitely the case.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by