Error using built-in residue function
조회 수: 5 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!