Plotting complex function with real and imaginary parts, but also with respect to the variable itself

5 visualizaciones (últimos 30 días)
Say I have an array x= [25 40 50] which gives me f(x)= [49.19 - 44.57i 78.70 - 71.31i 78.70 - 71.31i]
How can I plot the f(x) function (or scatter the numbers) with x being on the x axis, if I can? I know I can get real f(x) vs imag f(x) but I want to know how I can do this in 3D

Respuestas (1)

Steven Lord
Steven Lord el 3 de Nov. de 2021
Something like this?
x= [25 40 50];
fx= [49.19-44.57i, 78.70-71.31i, 78.70-71.31i];
plot3(x, real(fx), imag(fx))
  2 comentarios
Nee
Nee el 3 de Nov. de 2021
Thanks Steven, I actually figured this, but this is not what I was looking for. I wanted to plot 2D mapping, more like contouring- to see how the function changes if I keep sweeping through my variable in 2D.
Walter Roberson
Walter Roberson el 3 de Nov. de 2021
You can use scatteredInterpolant on the real and imaginary components separately, and use the interpolated real as y and the interpolated imaginary as z.

Iniciar sesión para comentar.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by