This is done with perceptual studies especially in mind.
For example output:
The function generateMotionStimulus shows the principle of making proper motion based stimulus without bias stemming from the discrete nature of the pixels. An example of making a moving disk INACCURATELY is provided by rendering 'aliasedDisk', and is contrasted with the proper way. Gabor patches type of stimulus in motion can be generated, to illustrate the usefullness of this script.
script playVid only works in windows. It shows how to call the VLC player using command line arguments from matlab, in a new thread with realtime priority. It is used to display the generated videos.
script runMe provides a demo.