Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross 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
Jul 6, 2007
1
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

Top