I have bodies with 8 properties. Last one is color. In each galaxy's bodies I give the same color, but different than other galaxy bodies.
bodies(i,8) = 'r';
When trying to plot seems I can't get it to color each body separately.
for i = 1:n,
points_x(i) = bodies(i,2);
points_y(i) = bodies(i,3);
points_z(i) = bodies(i,4);
points_col(i) = bodies(i,8);
end
% Remove the old plot.
if isempty(oldPlot)
oldPlot = fig;
elseif ~isempty(foundFig)
delete(oldPlot);
end
oldPlot = plot3(points_x,points_y,points_z, points_col);
drawnow
I get error: "An error occurred while running the simulation and the simulation was terminated Caused by: Not enough input arguments."
it only accepts one color for all
oldPlot = plot3(points_x,points_y,points_z, 'w.');
It might be the dot, I don't know...