
How to make the zplane function to plot on a existing axes?
조회 수: 11 (최근 30일)
이전 댓글 표시
채택된 답변
Paul
2022년 2월 13일
편집: Paul
2022년 2월 13일
You can specify an existing axis via a third argument. I didn't see this on the doc page, but it does show up in the help,
help zplane
The following code works fine on my local installation. It results in a figure with three lines and the zplane pole/zero plot..Don't know why it's not working here?
figure;
rng(101);
plot(rand(3));
hax = gca;
zplane([1 2 3],[3 2 1],hax)
Here is the figure I get on my machine:

댓글 수: 2
Paul
2022년 2월 14일
There should be link or something similar at the bottom of the doc page that allows you to provide feedback on a doc page if you wish.
추가 답변 (1개)
Voss
2022년 2월 13일
편집: Voss
2022년 2월 13일
I don't think you can do that with zplane(), but you can, in your own axes, fairly easily reproduce the lines that zplane() creates:
% First a zplane plot for reference:
[b,a] = ellip(4,3,30,200/500);
zplane(b,a);
% Now a new figure and axes with some stuff in it:
figure();
plot(linspace(-1,1,10),linspace(-1,1,10),'rs','LineWidth',2);
hold on
% Now, plotting what zplane(b,a) would plot:
axis equal
z = roots(b);
p = roots(a);
t = linspace(0,2*pi,1000);
blue = [0 0.447 0.741];
xl = get(gca(),'XLim');
yl = get(gca(),'YLim');
line(xl,[0 0],'Color',blue,'LineStyle',':','LineWidth',0.5);
line([0 0],yl,'Color',blue,'LineStyle',':','LineWidth',0.5);
line(cos(t),sin(t),'Color',blue,'LineStyle',':','LineWidth',0.5);
line(real(z),imag(z),'Color',blue,'LineStyle','none','Marker','o','MarkerSize',7);
line(real(p),imag(p),'Color',blue,'LineStyle','none','Marker','x','MarkerSize',8);
xlabel('Real Part');
ylabel('Imaginary Part');
참고 항목
카테고리
Help Center 및 File Exchange에서 Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!