Line Plot Complex Numbers
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Artificial_Spark
el 5 de Feb. de 2017
Comentada: Artificial_Spark
el 15 de Feb. de 2017
I'm having trouble producing a line plot graph using complex numbers. Currently the graph only shows the markers of the data plotted. Should l use a x-y graph and pretend the y is the imaginary axis? Or is a 3d plot a simpler way? I need to actually see the line from the origin point. Thank you for the assistance.
Here is my code:
%Variables
z1 = 0 + 2j;
z2 = -1 + 1j;
z3 = -3 - 4j;
z4 = 0 - 1j;
real_z1 = real(z1);
imag_z1 = imag(z1);
real_z2 = real(z2);
imag_z2 = imag(z2);
real_z3 = real(z3);
imag_z3 = imag(z3);
real_z4 = real(z4);
imag_z4 = imag(z4);
%Graph
plot(real_z1,imag_z1,'*',real_z2,imag_z2,'*',real_z3,imag_z3,'*',real_z4,imag_z4,'*');
grid on
axis([-5,5,-5,5])
xlabel('REAL'), ylabel('IMAG');
title('Complex Numbers');
legend('z1 = 0 + 2j','z2 = -1 + 1j','z3 = -3 - 4j','z4 = 0 - 1j');
2 comentarios
Ahmad Moniri
el 14 de Feb. de 2017
Have you looked at the function plotv? https://uk.mathworks.com/help/nnet/ref/plotv.html
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!