3d plot help

1 vue (au cours des 30 derniers jours)
jiyoung lee
jiyoung lee le 14 Juin 2019
Réponse apportée : KSSV le 14 Juin 2019
I'm almost new to use MATLAB
I want to change the dot colour in a 3D graph according to range
For example A(1,1,1) B(2,2,2), C(3,3,3) D(4,4,4) ... (X,Y,Z)
And X<=1, Y<=1, Z<=1 --> red dot / 1<X<=3, 1<Y<=3, 1<Z<=3 --> green dots / 3<X<=5, 3<Y<=5, 3<Z<=5 --> blue dot
(Please code easy to change the number)
-------------------------------------------------
Here what i've done
-------------------------------------------------
data=[1,1,1 ; 2,2,2 ; 3,3,3; 4,4,4]
x=data(:,1);
y=data(:,2);
z=data(:,3);
figure
scatter3(X,Y,Z)

Réponse acceptée

KSSV
KSSV le 14 Juin 2019
data=[1,1,1 ; 2,2,2 ; 3,3,3; 4,4,4]
x=data(:,1);
y=data(:,2);
z=data(:,3);
figure
scatter3(x,y,z,100,z,'filled')

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by