It's pretty much done for you. It's almost a standard demo. Try this on the command line:
>> teapotdemo
>> edit teapotdemo
The first one runs it and the second command lets you look at the code. Modify as needed.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!