Hi all, first off, I've seen this question asked several times all over the internet but there doesnt seem to be a solid answer to it anywhere (at least not a workable one for my situation). I am creating a GUI that inputs data into a genetic algorithm. I created this GUI in GUIDE and to start the process I have made a run button that calls the main function. I want to set the run button to display a different string as well as disable it for the run of the main function. So far the callback for the button looks like this:
function run_button_Callback(hObject, eventdata, handles) set(handles.run_button,'string','Running...','enable','off'); guidata(hObject,handles); [X] = get_X(hObject,handles,eventdata); Tower_driver(X) % Reset button
set(handles.run_button,'string','RUN','enable','on')
When I run this GUI straight from the figure (that is, clicking on the .fig file and only running the GUI) I get this error:
Reference to non-existent field 'run_button'. Error in TD_gui>run_button_Callback (line 687) set(handles.run_button,'string','Running...','enable','off');
When I run the GUI from editor or in debugger mode to examine the handles struct, I don't get any error. Any reason why this would be happening? Thanks!
– Ryan
Best Answer