On Oct 10, 2007, at 3:45 AM, David Bateman wrote:
Ben Abbott wrote:
Thanks David,
another attempt, if you don't mind
p = roots([1 0 18 0 81])
p =
-0.0000 + 3.0000i
-0.0000 - 3.0000i
0.0000 + 3.0000i
0.0000 - 3.0000i
octave:1> p = roots([1 0 18 0 81])
p =
0.0000 + 3.0000i
0.0000 - 3.0000i
-0.0000 + 3.0000i
-0.0000 - 3.0000i
[e, indx] = mpoles (p)
e =
1
2
1
2
indx =
1
3
2
4
octave:2> [e, indx] = mpoles (p)
e =
1
2
1
2
indx =
2
4
1
3
p(indx)
ans =
-0.0000 + 3.0000i
0.0000 + 3.0000i
-0.0000 - 3.0000i
0.0000 - 3.0000i
octave:3> p(indx)
ans =
0.0000 - 3.0000i
-0.0000 - 3.0000i
0.0000 + 3.0000i
-0.0000 + 3.0000i
Thanks again. I believe I've found the bug ... and it is mine :-(
Using the attached mpoles.m, I get
p = roots([1 0 18 0 81])
p =
-0.0000 + 3.0000i
-0.0000 - 3.0000i
0.0000 + 3.0000i
0.0000 - 3.0000i
[e, indx] = mpoles(p)
e =
1
2
1
2
indx =
1
3
2
4
I assume you will get the same.