Plotting a complex exponential, exp(i*x), in 3D?

조회 수: 53 (최근 30일)
Steven
Steven 2016년 1월 15일
댓글: Star Strider 2021년 12월 3일
Hi, I try to plot the complex exponential, exp(i*x), in 3D. As in https://qph.is.quoracdn.net/main-qimg-b7ac15119bfa0a4840084c98da915ed8?convert_to_webp=true. Using plot or fplot, I got the warning "Imaginary parts of complex X and/or Y arguments ignored" and with ezplot: "This function has no real values".
Any suggestions on how to make such a plot in Matlab?
Thanks, Steven

채택된 답변

Star Strider
Star Strider 2016년 1월 15일
This approximates it:
t = linspace(0, 2.5, 250);
f = exp(2*pi*4/2.5*1i*t);
figure(1)
plot3(t, real(f), imag(f), 'LineWidth',2)
hold on
plot3(t, real(f), zeros(size(t))-1.5)
plot3(t, zeros(size(t))-2, imag(f))
hold off
grid on
axis([-1 3 -2 2 -1.5 1.5])
view([-125 30])
xlabel('Time', 'Rotation',-30)
ylabel('Real Axis', 'Rotation',10)
zlabel('Imag Axis')
If you want to add the labels, see the documetation for the text function.
  댓글 수: 4
appala naidu k
appala naidu k 2021년 12월 3일
Dear sir, Can you please help to plot the same graph for exponential decay and rise?
Star Strider
Star Strider 2021년 12월 3일
Just multiply the exponential term with it.
t = linspace(0, 2.5, 250);
f = exp(2*pi*4/2.5*1i*t);
e = exp(-0.5*t);
fe = f .* e;
figure(1)
plot3(t, real(fe), imag(fe), 'LineWidth',2)
hold on
plot3(t, real(fe), zeros(size(t))-1.5)
plot3(t, zeros(size(t))-2, imag(fe))
hold off
grid on
axis([-1 3 -2 2 -1.5 1.5])
view([-125 30])
xlabel('\leftarrow Time', 'Rotation',-30)
ylabel('Real Axis', 'Rotation',10)
zlabel('Imag Axis')
Make appropriate changes to get different results.
.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Steven Lord
Steven Lord 2016년 1월 15일
x = 0:0.1:10;
yz = exp(1i*x);
plot3(x, real(yz), imag(yz))
ylabel('\Re(e^{1i*x})');
zlabel('\Im(e^{1i*x})');

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by