This MATLAB code generates a figure plot of the Earth and an orbit which can be manipulated with GUI sliders, each corresponding to an orbital element. The main functions are nested within the same script.
References:
Code uses function earthSphere by Clay M. Thompson 4-24-1991, CBM 8-21-92. Will Campbell, 3-30-2010 Copyright 1984-2010 The MathWorks, Inc. Some code adapted from a course: Astrodynamics by Dr. Anil Rao, Professor, University of Florida. See www.anilvrao.com