Here is 45 MB AVI movie showing the program I wrote to solve this problem. pendulum.avi
To run the program, download this zip file and extract it. It will create a new folder called code
Next, add this folder to your Matlab path (using Matlab file-> set path).
Then from Matlab command window, type
eme_121_lab1