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

采纳的回答

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
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