i wanna to plot the eulars formula on matlab with 3d plot

조회 수: 4 (최근 30일)
Muhammad
Muhammad 2021년 6월 26일
편집: Jan 2021년 6월 26일
t = -1:1:1;
eulars formual
x= cos(wt)+jsin(wt);
we shoul have 3d plot like this
sig=2;
x = cos(sig*t) + sin(sig*t)*i;
z= cos(sig*t);
y=sin(sig*t)*i;
plot3(x,y,z)

채택된 답변

Star Strider
Star Strider 2021년 6월 26일
Try this —
t = linspace(0, 3*pi);
sig=2;
x = cos(sig*t) + sin(sig*t)*1i;
z = cos(sig*t);
y = sin(sig*t)*i;
figure
plot3(t,real(x)+0.5,imag(x)+0.5, 'LineWidth',2)
hold on
plot3(t, real(x), zeros(size(x))-1, 'LineWidth',2)
plot3(t, zeros(size(x))+2, imag(x), 'LineWidth',2)
hold off
grid on
I will let you experiment with to understand how it works!
.

추가 답변 (1개)

Jan
Jan 2021년 6월 26일
편집: Jan 2021년 6월 26일
t = linspace(-1, 1, 200);
r = cos(2 * pi * t) + 1i * sin(2 * pi * t);
figure;
plot3(t, real(r), imag(r), 'Color', 'k', 'LineWidth', 3);
hold('on');
plot3(t, repmat(-2, size(r)), imag(r), 'Color', 'k', 'LineStyle', '-');
plot3(t, real(r), repmat(-2, size(r)), 'Color', 'k', 'LineStyle', '-.');
axis equal
xlabel('t (sec)');
ylabel('Real Axis');
zlabel('Imag Axis');
xlim([-2, 2])
ylim([-2, 2])
grid('on');
view(-120, 20);
Do you see, that the imaginary axis is mirrored compared to your diagram? Your diagram shows:
r = cos(2 * pi * t) - 1i * sin(2 * pi * t);
% ^

카테고리

Help CenterFile Exchange에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by