How to plot a function with complex variables?

21 visualizzazioni (ultimi 30 giorni)
Hello guys, how do I plot a function with complex variables? For instance, I want to plot a function shown in attached file for |z|<1.
Thanks!

Risposta accettata

Star Strider
Star Strider il 27 Giu 2018
I am not certain from your description what you want to plot.
Try this:
ang = 0:0.1:2*pi;
z = exp(1i*ang);
f = @(z) 1./z;
figure
plot(real(f(z)), imag(f(z)))
axis equal
figure
plot(ang, real(z))
hold on
plot(ang, imag(z))
hold off
grid
The first figure plots the imaginary component as a function of the real component. The second plots both as a function of ‘ang’.

Più risposte (1)

Mark Saad
Mark Saad il 27 Giu 2018
Modificato: dpb il 25 Giu 2020
  1 Commento
Jullienne Franz
Jullienne Franz il 27 Giu 2018
Thank you for your sugestion, but I can't seem to follow how to do that in my case. To simplify my question, how do I plot the function, say f(z)=1/z for |z|<1, where z is a complex number.

Accedi per commentare.

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by