i wanna to plot the eulars formula on matlab with 3d plot
4 次查看(过去 30 天)
显示 更早的评论
t = -1:1:1;
eulars formual
x= cos(wt)+jsin(wt);
we shoul have 3d plot like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/666285/image.png)
sig=2;
x = cos(sig*t) + sin(sig*t)*i;
z= cos(sig*t);
y=sin(sig*t)*i;
plot3(x,y,z)
0 个评论
采纳的回答
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!
.
0 个评论
更多回答(1 个)
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);
% ^
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two y-axis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!