フィルターのクリア

How to removed dashed lines in fplot

12 ビュー (過去 30 日間)
Adam Harris
Adam Harris 2021 年 7 月 8 日
コメント済み: Star Strider 2021 年 7 月 8 日
Hello, these horizontal dashed lines are showing up unexpectedly in my plot. I'm hoping someone can tell me how to remove them. Thanks!
The code is as follows:
figure(3)
fplot(kre2(omega),'k',[.01,50],'LineWidth',2);
hold on
fplot(-kim2(omega),'-.k',[.01,50],'LineWidth',2)
hold off
title('Frequency Spectrum For Periodic Unit Cell')
xlabel('Frequency, \Omega')
xlim([0,50])
ylabel('Wavenumber, \xi')
ylim([-pi,pi-.01])
view([90 -90])
yline(0,'LineWidth',2)

採用された回答

Star Strider
Star Strider 2021 年 7 月 8 日
The dashed lines indicate singularities, and I find them helpful.
They can’t be removed, however it is possible to get the XData and YData from fplot and re-plot them.
syms x
y = 1/(x^2-2*x-1);
figure
hfp = fplot(y, [-5 5]);
X = hfp.XData;
Y = hfp.YData;
Y(Y>100) = NaN;
figure
plot(X, Y)
grid
ylim(hfp.Parent.YLim)
That’s the only way I’ve found not to plot the singularity llines.
Make appropriate changes to get the result you want.
.
  2 件のコメント
Adam Harris
Adam Harris 2021 年 7 月 8 日
Thank you very much!
Star Strider
Star Strider 2021 年 7 月 8 日
As always, my pleasure!
.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by