I'm working on a project where we need to create an animation using loops. I came up with the idea of doing similar to earth orbiting the sun. So I have two spheres. One larger one that stays put, but rotates about the Z-axis, and then a smaller one that travels around the larger one in a circular path. I'm having an issue with the smaller sphere leaving images as it moves around the circular path. I'd like to get this cleaned up and failed to find something with set that worked for me. This is the last bit I have at the moment and any help would be appreciated.
s1 = surf (a,b,c,'facecolor','yellow');
ax = gca; set(ax,'Color','k');
title('Space... The Final Frontier');
s1.FaceLighting = 'gouraud';