Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

GUI .... tricks of the trade

Status
Not open for further replies.

juzty

New member
Joined
Jul 6, 2007
Messages
1
Location
GB
I have writen a GUI. I have lots of input fields and one run button. However to run it I always have to always enter something into every field. Some inputs have defaults values I can assign in the .m file. In the run button callback sub function how do I check if there is an input or in must resort to a default value??

My code at the mo (not working):

%input field callback:
handles.output= str2double(get(hObject,'String'));

%run button callback:
if exist('handles.output') == 0
X = 10;
else
X = handles.output;
end

why? why? why?

It always says : it always goes in the first one (X = 10) ie it never finds handles.output ... even if it does exist sometimes!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top