This mechanism is the print command with the -dmfile flag. Usually, information such as the figure's Colormap and any UserData that you've created are stored in the MAT-file. These values indicate that they contain data which has been stored in the MAT-file. . . . Before talking about how to deal with the design of your code to handle overwriting your files, we need to look at how a very simple GUI is built using traditional methods. For people that have never programmed a GUI before, it's important to describe exactly what a callback is.
Callbacks define code that gets executed when a particular type of event occurs.
For instance, when the user resizes a figure the ResizeFcn of the figure is executed. As with all callback type properties, the ResizeFcn must be a single line string and will always get evaluated in the base workspace. The fact that the callback gets evaluated in the base workspace is important. Try it out. As you can see, the callback is a single line, though it does contain multiple commands.