Error using built-in residue function

조회 수: 5 (최근 30일)
Kaleb Christoffersen
Kaleb Christoffersen 2013년 2월 11일
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

채택된 답변

Walter Roberson
Walter Roberson 2013년 2월 11일
Please use
which -all poly
to find out whether you have a poly.m that is overriding the expected poly function.
  댓글 수: 1
Kaleb Christoffersen
Kaleb Christoffersen 2013년 2월 11일
편집: Kaleb Christoffersen 2013년 2월 11일
AMAZING! Thank you so much for that tiny but oh so useful bit of information. That was definitely the case.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by