tf2zp behaves weird

4 views (last 30 days)
Ernest Milenko
Ernest Milenko on 28 Sep 2011
I need to obtain poles and zeros for system, here is a code: [b,a] = eqtflength(b,a); [z p] = tf2zp(b, a );
it gives me this error: In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in ==> testfile at 140 [z p] = tf2zp(b , a );
have no idea why? im following exactly the example code. before equality b has size 1 and a has size 5, after equality both are sized 5

Accepted Answer

Wayne King
Wayne King on 28 Sep 2011
Hi, Ernest, it should not fail.
Try this.
b = [1 0 0 0 0];
a = [ 1.0000 0.4000 1.0000 0.2500 0.5000];
[z,p] = tf2zp(b,a);
Does this work for you? If so, then please post the relevant part of your code where you call tf2zp().
If the above errors, then make sure that you have the MATHWORKS' tf2zp() and not some local version, when you enter
>>which tf2zp
what is returned?
Wayne

More Answers (1)

Ernest Milenko
Ernest Milenko on 28 Sep 2011
the system had more than one pole, and return vectors were not sized for that. thank you.

Community Treasure Hunt

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

Start Hunting!