Specifications

1 Getting Started with GUIDE
1-30
You can use the following code in the edit text callback. It gets the value of the
String property and converts it to a double. It then checks if the converted
value is
NaN, indicating the user entered a non-numeric character (isnan) and
displays an error dialog (
errordlg).
function edittext1_Callback(h,eventdata,handles,varargin)
user_entry = str2double(get(h,'string'));
if isnan(user_entry)
errordlg('You must enter a numeric value','Bad Input','modal')
end
% proceed with callback...
Triggering Callback Execution
On UNIX systems, clicking on the menubar of the figure window causes the
edit text callback to execute. However, on Microsoft Windows systems, if an
editable text box has focus, clicking on the menubar does not cause the editable
text callback routine to execute. This behavior is consistent with the respective
platform conventions. Clicking on other components in the GUI execute the
callback.
Static Text
Static text controls displays lines of text. Static text is typically used to label
other controls, provide directions to the user, or indicate values associated with
a slider. Users cannot change static text interactively and there is no way to
invoke the callback routine associated with it.
Sliders
Sliders accept numeric input within a specific range by enabling the user to
move a sliding bar. Users move the bar by pressing the mouse button and
dragging the slide, by clicking in the trough, or by clicking an arrow. The
location of the bar indicates a numeric value.
Slider Orientation
You can orient the slider either horizontally or vertically by setting the relative
width and height of the
Position property:
Horizontal slider – width is greater than height.
Vertical slider – height is greater than width.