%% Set Scatter Series Properties Using Handle
% Use the |sphere| function to create vectors |x|, |y|, and |z|. 

% Copyright 2015 The MathWorks, Inc.


[X,Y,Z] = sphere(16);
x = [0.5*X(:); 0.75*X(:); X(:)];
y = [0.5*Y(:); 0.75*Y(:); Y(:)];
z = [0.5*Z(:); 0.75*Z(:); Z(:)];

%%
% Create vectors |s| and |c| to specify the size and color for each marker.

S = repmat([70,50,20],numel(X),1);
C = repmat([1,2,3],numel(X),1);
s = S(:);
c = C(:);

%%
% Create a 3-D scatter plot and return the scatter series object. 
h = scatter3(x,y,z,s,c);

%%
% Use an RGB triplet color value to set the marker face color. Starting in
% R2014b, you can use dot notation to set properties. If you are using an
% earlier release, use the <docid:matlab_ref.f67-432995> function instead.
h.MarkerFaceColor = [0 0.5 0.5];