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

1 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by