fcontour and fplot showing distorted images...

1 visualización (últimos 30 días)
Ozgur Toprak Sahin
Ozgur Toprak Sahin el 8 de En. de 2022
Comentada: Star Strider el 8 de En. de 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
(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);

Respuesta aceptada

Star Strider
Star Strider el 8 de En. de 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')
.
  2 comentarios
Ozgur Toprak Sahin
Ozgur Toprak Sahin el 8 de En. de 2022
Thank you for helping me out : )
Star Strider
Star Strider el 8 de En. de 2022
As always, my pleasure!
.

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by