fcontour and fplot showing distorted images...

1 次查看(过去 30 天)
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')
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by