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

5 vues (au cours des 30 derniers jours)
Muhammad
Muhammad le 26 Juin 2021
Modifié(e) : Jan le 26 Juin 2021
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)

Réponse acceptée

Star Strider
Star Strider le 26 Juin 2021
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!
.

Plus de réponses (1)

Jan
Jan le 26 Juin 2021
Modifié(e) : Jan le 26 Juin 2021
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);
% ^

Catégories

En savoir plus sur Performance and Memory dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by