How can I plot both real part and imaginary part with contour plot
Mostrar comentarios más antiguos
From topic, how can I plot both of this? (2D plot)
thank you for your answer.
in command windows
Error using contourf (line 55) Input arguments for contour must be real. Use the function REAL to get the real part of the inputs.
1 comentario
Balaji Ramdas
el 4 de En. de 2022
I have the same error, let me know if u get the answer
Respuestas (1)
Walter Roberson
el 4 de En. de 2022
Method 1:
subplot(2,1,1)
contour(X, Y, real(Z), REAL_LEVELS)
title('real')
subplot(2,1,2)
contour(X, Y, imag(Z), IMAGINARY_LEVELS)
title('imaginary')
Method 2:
contour(X, Y, abs(Z), ABS_LEVELS)
Method 3:
contour(X, Y, real(Z), REAL_LEVELS)
hold on
contour(X, Y, imag(Z), IMAGINARY_LEVELS)
All three methods have drawbacks.
Sometimes what you need is more like
quiver(X, Y, real(Z), imag(Z))
Categorías
Más información sobre Contour Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!