3D scatter plot stained with Z-value

I was looking for time to search, but could not find a solution to the problem. I am an amateur matlab user, and I would like to create a 3D scattering diagram, for this I have a matrix containing several points in three-dimensional space:

>> size(A)

  ans =

        2511           3

I managed to create a three-dimensional scatterplot using the scatter function, but now I am a little fixated on the color coding of three-dimensional dots.

scatter3 (A (:, 1), A (:, 2), A (:, 3));

This will display the data, but now I would like to add color coding based on z-Value ... The colors themselves do not really matter. It can be a rainbow spectrum or a temperature spectrum or something else. I just would like their color codes to distinguish z-values โ€‹โ€‹of points.

Can someone help me? Thank!

+5
1

scatter3.

scatter3(X,Y,Z,S,C);

S ( ) , C . C - , . , colormap(jet), . . colormap.

, . :

scatter3(A(:,1),A(:,2),A(:,3),9,A(:,3));
colormap(jet); %# or other colormap
+7

All Articles