A popular way of launching a small satellite is to bring it up on an International Space Station resupply mission. The Spacecraft Control Toolbox has functions to help you animate the orbit of your spacecraft near the ISS. A function, ISSOrbit, generates the orbital elements for the ISS. ISSOrbit generates Keplerian Elements from the latest 2-line elements. We use the function CoplanarOrbit to create an orbit 50 m below the ISS. There are no disturbances and the gravity model is for a point mass Earth.

DrawSpacecraft.m is a function that will draw any number of spacecraft in the viewer. This is the ISS and our, very small, NanoSatellite. The MATLAB camera controls allow you to zoom in or rotate the view. The view is with respect to the first satellite entered in the argument list, which in this case is the nano satellite.

DrawSpacecraft also does animation and will create an avi file. You can see the animation on our YouTube Channel or by clicking the video below. We converted the avi file to an mp4 file using a movie converter.
The script is an m-file that you can download, just to view, here.
You won’t be able to run the script without the rest of the toolbox. It shows how you can easily create animations.