fcontour and fplot showing distorted images...

1 回表示 (過去 30 日間)
Ozgur Toprak Sahin
Ozgur Toprak Sahin 2022 年 1 月 8 日
コメント済み: Star Strider 2022 年 1 月 8 日
I can still use ezplot and ezcontour just fine. But fplot and fcontour has distorted images that makes the plot unreadable. Here is a comparison from a code I wrote.
1)fplot
(for some reason I couldn't convert this jpg so I took a screenshot)
2)ezplot
3)fcontour
4)ezcontour
In case you are curious here is the code
clear all
clc
syms k a b x
e=exp(sym(1));
assume (a>0);
%a=6;
z(k,a)=(((e^(2*i*k*a))-1)/(2*i*k*((pi*a)^(1/2))*(e^(i*k*a))))
%fplot(z);
%ezplot(z);
ezcontour (z);
%fcontour(z);

採用された回答

Star Strider
Star Strider 2022 年 1 月 8 日
Separate the real and imag parts of the function and it works —
syms k a b x
e=exp(sym(1));
assume (a>0);
%a=6;
z(k,a)=(((e^(2*i*k*a))-1)/(2*i*k*((pi*a)^(1/2))*(e^(i*k*a))))
z(k, a) = 
figure
%fplot(z);
%ezplot(z);
% ezcontour (z);
fcr = fcontour(real(z),'-r');
% get(fcr)
hold on
fci = fcontour(imag(z), '-b');
hold off
grid on
% legend('\Re{z}','\Im{z}', 'Location','bestoutside')
.
  2 件のコメント
Ozgur Toprak Sahin
Ozgur Toprak Sahin 2022 年 1 月 8 日
Thank you for helping me out : )
Star Strider
Star Strider 2022 年 1 月 8 日
As always, my pleasure!
.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by