This answer complements the excellent existing answer with a full example and uses information gained from the answer at this post.
I find the easiest way to apply color using scatter3
is through the colormap
.
From the documentation (emphasis mine):
scatter3(X,Y,Z,S,C) draws each circle with the color specified by C.
If C is a RGB triplet or character vector or string containing a color
name, then all circles are plotted with the specified color.
If C is a three column matrix with the number of rows in C equal to
the length of X, Y, and Z, then each row of C specifies an RGB color
value for the corresponding circle.
If C is a vector with length equal to the length of X, Y, and Z, then
the values in C are linearly mapped to the colors in the current
colormap.
Full example provided below with customization (except for marker size control).

% MATLAB R2017a
% Data
NumPoints = 25;
X = 100*rand(NumPoints,1);
Y = 100*rand(NumPoints,1);
Z = 100*rand(NumPoints,1);
V = (X + Y);
% Create custom colormap (2 color example)
col1 = [0 1 0]; %G
col2 = [1 0 0]; %R
cmap = interp1([col1; col2], linspace(1, 2, 101)); % Create the colormap
% Plot
colormap(cmap), hold on, box on
h = scatter3(X,Y,Z,[],V,'filled')
view(-25,25) % (azimuth,elevation)
% Colorbar Controls
cb = colorbar;
caxis([0 200]) % sets min and max value for color mapping (separate from tick control)
cb.Limits = [0 200];
cb.Ticks = [0:25:200]; % custom set colorbar ticks
cb.Label.String = ' V';
cb.Label.Rotation = 0; % Default is 90
% Cosmetics
h.MarkerEdgeColor = 'k'; % Set marker edge color to black
xlabel('X')
ylabel('Y')
zlabel('Z')