fcontour and fplot showing distorted images...

1 view (last 30 days)
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);

Accepted Answer

Star Strider
Star Strider on 8 Jan 2022
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')
.

More Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!