%% Control Comet Body Length
% Create a comet plot and specify the comet body length by setting the scale factor input p. The comet body is a trailing segment in a different color that follows the head before fading.
% Use the peaks function to load x, y, and z data in matrix forms. Convert the data into vector arrays. Specify p as 0.5 so that the body length is 0.5*length(y). Then, plot the data.
%

[xmat,ymat,zmat] = peaks(100); 
xvec = xmat(:);
yvec = ymat(:);
zvec = zmat(:);
p = 0.5;
comet3(xvec,yvec,zvec,p)

% Copyright 2019 The MathWorks, Inc.
%
%