Specifications

Managing GUI Data with the Handles Structure
4-27
Defining the Data Fields in the Opening Function
The GUI records the number of times a user enters an erroneous value in the
text box and stores this number in a field of the
handles structure. You can
define this field, called
number_errors, in the opening function as follows:
handles.number_errors = 0;
Type this command before the following line, which GUIDE automatically
inserts into the opening function.
guidata(hObject, handles); % Save the updated structure
The guidata command saves the handles structure so that it can be retrieved
in the callbacks.
Note To save any changes that you make to the handles structure, you must
add the command
guidata(hObject, handles) following the code that
implements the changes.
Setting the Edit Text Value from the Slider Callback
The following command in the slider callback updates the value displayed in
the edit text when a user moves the slider and releases the mouse button.
set(handles.edit1,'String',...