User`s guide
9 Managing and Sh aring Application Data in GUIDE
3 edit sli derb ox_guidata or click here to open the GUI code file in the
Editor.
You can view the properties of any component by double-clicking it in the
Layout Editor to open the Property Inspector for it. You can modify either
the figure, the code, or both. Then you can save the G UI in your current
folder using File > Save as from GUIDE. This saves both files, allowing
you to rename them if you choose.
IfyoujustwanttoruntheGUIorinspectitinGUIDE,followthesesteps:
1 ClickheretoaddtheexamplefilestotheMATLABpath(onlyforthe
current session).
2 Click here to run the sliderbo x_gu idata GUI.
3 Click here to display the GUI in the GUIDE Layout Editor (read-only).
4 ClickheretodisplaytheGUIcodefileintheMATLABEditor(read-only).
Note Do n o t save GUI files to the examples folder where you fo und them,
or you will overwrite the original files. If you want to s ave the G UI files,
use File > Save as from GUIDE, which saves both the GUI FIG-file and
the GUI code file.
How Sharing Data with GUI Data Works. All GUI callbacks can access
GUI data. A callback for one component can set a value in GUI data, which, a
callback for another component can then read. This exam ple uses GUI data to
initialize and maintain an error counter.
Note For more information, see “GUI Data” on page 9-7 .
The GUI behavior is as follows:
• When a user moves the slider, the edit text component displays the slider’s
current value.
9-18