How to create a cuboid by connecting points through scatter3 plot?

1 Ansicht (letzte 30 Tage)
Swati Sarangi
Swati Sarangi am 6 Nov. 2020
Kommentiert: KSSV am 6 Nov. 2020
Hi All,
I am following the approach to draw the cuboid by plotting the coordinates of the vertices through scatter plot; scatter3 and connecting the vertices through lines.
Here's my code; (I'm getting just discrete points from it but I want connections between points too)
Aa=30; Bb=30; Cc=30;
na=5; nb=5; nc=5;
lx=linspace(0,Aa,na);
ly=linspace(0,Bb,nb);
lz=linspace(0,Cc,nc);
scatter3(0,0,0,'r')
hold on
scatter3(1,0,0,'r')
hold on
scatter3(1,1,0,'r')
hold on
scatter3(0,1,0,'r')
hold on
scatter3(0,1,1,'r')
hold on
scatter3(0,0,1,'r')
hold on
scatter3(1,0,1,'r')
hold on
scatter3(1,1,1,'r')
hold on
figure;
line(lx,ly,lz)
can some one suggest how to do it?
Thanks in advance!
Regards
Swati

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by