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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/177162/image.png)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!