0

Using the code for plot_pz([poles],[zeros])

function plot_pz(b,a) 
b_roots = roots(b);
a_roots = roots(a);
plot(b_roots,'x black');
plot(a_roots,'o blue');
axis equal;

I can get my b_roots to plot properly, but my a_roots continually plot on the 1+0i axis (or x=1). For example, the Z-Transform H(z) = [[1 2 2],[0 1 .8]] gives the following poles and zeros (per matlab):

poles =
 -1.0000 + 1.0000i
 -1.0000 - 1.0000i
zeros =
 -0.8000

It should look like this

Correct H(z)

but instead what I get is

Wrong H(z)

Where my zeros are at -1+1i and -1-1i, and my poles seem to be at 1-.8i, but should instead be at -.8+0i

I'm sure it's something simple that I'm missing, but I can't figure it out. I think it only happens when I have a single pole or a single zero.

Does plot(X) always default to plotting 1+xi?

asked Apr 17, 2015 at 23:07

1 Answer 1

1

Fixed by being more clear with real() and imag()

plot(real(b_roots),imag(b_roots),'o blue');
plot(real(a_roots),imag(a_roots),'x red');
answered Apr 17, 2015 at 23:19
Sign up to request clarification or add additional context in comments.

2 Comments

You can accept your own answer since it fixed your problem :)
Thank you for that tip, Benoit_11!

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.