【发布时间】:2015-04-23 18:28:01
【问题描述】:
我正在尝试在 Matlab 中绘制一个 zplot,它显示一个单位圆,以 0 为中心以及绘图的极点和零点。我不允许使用任何其他 matlab 函数,例如 zplane 或 pzplot 来执行此操作。到目前为止,我能够很好地绘制一个单位圆,但是我无法让我的绘图显示更多的轴而不扭曲我的圆。我也很高兴找到我的函数的极点和零点,以及如何在我的情节上将极点显示为小 x,将零点显示为小 o。任何帮助将不胜感激!我的作业看起来像这样,必须正确处理诸如
之类的情况zplot([0 1 1], [0 1]); zplot([0 1 1], [0 0 1]);
function zplot(b, a)
% ZPLOT Plot a zero-pole plot.
-1 -nb
B(z) b(1) + b(2)z + .... + b(nb+1)z
H(z) = ---- = ---------------------------------
-1 -na
A(z) a(1) + a(2)z + .... + a(na+1)z
% zplot(b, a) plots the zeros and poles which determined by vectors b and a
% The plot includes the unit circle and axes for reference, plotted in black.
% Each zero is represented with a blue 'o' and each pole with a red 'x' on the
%plot.
xmin;
xmax;
ymin;
ymax;
% vector of angles at which points are drawn
angle = 0:2*pi/100:2*pi;
% Unit radius
R = 1;
% Coordinates of the circle
x = R*cos(angle);
y = R*sin(angle);
% Plot the circle
plot(x,y);
axis ([xmin, xmax, ymin, ymax]);
grid on;
end
【问题讨论】:
-
问题的截图?一个样本系统或一组极点/零点进行测试?
-
它应该能够正确处理诸如:zplot([0 1 1], [0 1]); zplot([0 1 1], [0 0 1]);
-
请用上述内容更新您的问题。还请发布一个可视化问题的屏幕截图。
-
krisdestruction 我无法发布我的情节的屏幕截图,因为我没有足够高的声誉。对此感到抱歉。
-
下一次,只需用链接或其他内容发表评论,我们就可以为您编辑。检查下面的解决方案,如果正确,请接受。
标签: matlab graph filtering axis sequences