juzty
New member
- Jul 6, 2007
- 1
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!!
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!!