Clear Filters
Clear Filters

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

3 views (last 30 days)
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)

Accepted Answer

Star Strider
Star Strider on 26 Jun 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!
.

More Answers (1)

Jan
Jan on 26 Jun 2021
Edited: Jan on 26 Jun 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);
% ^

Categories

Find more on Function Creation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!