How to scatter3 row vector with different colors

4 Ansichten (letzte 30 Tage)
Norsalina Hassan
Norsalina Hassan am 27 Jul. 2021
Kommentiert: KSSV am 28 Jul. 2021
Hi,
I have 3 row vectors (3x510 double). I want to use different color for each row. How can I plot using scatter3 function?
Please help.
Thanks in advance.
  2 Kommentare
Chunru
Chunru am 27 Jul. 2021
scatter3 plot z vs x, y. What is your data vector?
Norsalina Hassan
Norsalina Hassan am 27 Jul. 2021
This is what I did before
scatter3(OMEGA(1,:), OMEGA(2,:), OMEGA(3,:),'b*'), but i need each row to be different colors

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV
KSSV am 27 Jul. 2021
Bearbeitet: KSSV am 27 Jul. 2021
LEt A be your 3*510 matrix.
x = A(1,:) ;
y = A(2,:) ;
z = A(3,:) ;
scatter(x,y,10,z,'.');
If you want to use scatter3.
scatter3(x,y,z,100,z,'.');
  2 Kommentare
Norsalina Hassan
Norsalina Hassan am 28 Jul. 2021
Thanks. It's work
KSSV
KSSV am 28 Jul. 2021
Thanks is accepting/ voting the answer.

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by