3d lines plot

조회 수: 4 (최근 30일)
Istvan
Istvan 2025년 2월 12일
댓글: Star Strider 2025년 2월 13일
Dear everybody,
I have a problem, I want to draw 3 line.
First line: In xy plan has to be sin(x) ;
Second line: In xz plan has to be cos(x) ;
Third line: In xyz plan has to be sin(x)+cos(x);
I have no idea for it. What is the solution?
I will appreciate your help.
Thank you.
Istvan
  댓글 수: 2
Sam Chak
Sam Chak 2025년 2월 12일
Hi @Istvan, The first curve is , and the second curve is . But I cannot visualize the third curve on the so-called "x-y-z" plane. Can you sketch it?
Istvan
Istvan 2025년 2월 12일
편집: Istvan 2025년 2월 12일
It would be an elliptically polar wave. in this picture the cos and sin function are replaced, but the point is the same.

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

채택된 답변

Star Strider
Star Strider 2025년 2월 12일
Peerhaps something like this —
t = linspace(0, 1).';
x = sin(2*pi*t);
y = cos(2*pi*t);
z = x+y;
figure
plot3(x, y, z)
grid on
xlabel('X')
ylabel('Y')
zlabel('Z')
axis('equal')
figure
stem3(x, y, z, '.')
hold on
patch(x, y, zeros(size(z)), 'g', FaceAlpha=0.5)
hold off
grid on
xlabel('X')
ylabel('Y')
zlabel('Z')
axis('equal')
figure
patch(x, y, z, 'r', FaceAlpha=0.5)
hold on
patch(x, y, zeros(size(z)), 'g', FaceAlpha=0.5)
hold off
grid on
axis('equal')
xlabel('X')
ylabel('Y')
zlabel('Z')
view(-27, 30)
.
  댓글 수: 6
Istvan
Istvan 2025년 2월 13일
@Star Strider Perfect, that is exatly what i thought.
I am grateful to you.
Thank you.
Best regards.
Star Strider
Star Strider 2025년 2월 13일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by