- Add a “uibutton” to the GUI
- Add a “ButtonPushed” callback to it.
- Use “exportgraphics” function to save it in any format.
- exportgraphics: https://www.mathworks.com/help/matlab/ref/exportgraphics.html
- uibutton: https://www.mathworks.com/help/matlab/ref/uibutton.html