Creating Graphical User Interfaces    

Opening Function

The code in the opening function is executed just before the GUI is made visible to the user. You can add code to the opening function to perform tasks that need to be done before the user has access to the GUI, for example, to create data or to read data from an external source. In this example, you add code that creates three data sets in the opening function, using the MATLAB functions peaks, membrane, and sinc. This code is described in the section Adding Code to the Opening Function.

Note that GUIDE names the opening function with the name of the M-file prefixed to _OpeningFcn. In this example, the M-file is named simple_gui.m, so that the opening function is named simple_gui_OpeningFcn.


  Opening the GUI M-File Sharing Data Between Callbacks