How to make the zplane function to plot on a existing axes?
29 ビュー (過去 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!