3d lines plot
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Istvan
am 12 Feb. 2025
Kommentiert: Star Strider
am 13 Feb. 2025
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 Kommentare
Sam Chak
am 12 Feb. 2025
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?
Akzeptierte Antwort
Star Strider
am 12 Feb. 2025
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 Kommentare
Star Strider
am 13 Feb. 2025
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





