fcontour and fplot showing distorted images...
1 view (last 30 days)
Show older comments
Ozgur Toprak Sahin
on 8 Jan 2022
Commented: Star Strider
on 8 Jan 2022
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/857350/image.png)
2)ezplot
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/857355/image.jpeg)
3)fcontour
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/857360/image.jpeg)
4)ezcontour
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/857365/image.jpeg)
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);
0 Comments
Accepted Answer
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))))
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 Comments
More Answers (0)
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!