how to color my scatter3 values according to a cluster label
Show older comments
hi guys, so i am stuck on coloring my xyz values separately while using the scatter3 func.
so i have this code
load('../mat/coor.mat') % where the coor nodes are stored
x = coor(:,1); % correspond xyz to values on coor
y = coor(:,2);
z = coor(:,3);
scatter3(x,y,z,100);
where i correspond my xyz values to the values on my coor file and then i make a scatter3 plot of those values.
My next step is to color these xyz values according to my specific cluster labels that are stored in a separate matrix titled 'ciu' which is a 384x1 matrix with k=1,2, and 3. How would I go about doing that?
Any help would be appreciated, thank you so much!
Edit: more background
So coor.mat is a 384x3 matrix, meaning that coor.mat line 1 directly corresponds to ciu-matrix line 1. For example, (x1,y1,z1) = 1, (x2,y2,z2) = 3, etc.
What I want to do is to write a line that has matlab make that connection and then assign each of the three cluster labels their own color on the plot generated via scatter3.
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!