Hi,
I have a piece of main code in which I call a GUI. In the GUI, the OpeningFcn function contains some code and calls uiwait:
handles.output = hObject;% Set handles fields with initial values from UIcontrols
handles.speedrange = str2double(get(handles.editSpeedRange,'String'));% Update handles structure
guidata(hObject, handles);% UIWAIT makes pitch_bounce_input_gui wait for user response (see UIRESUME)
uiwait(handles.bounce_pitch_fig);
The user can change a series of edit box values, which are all captured in the handles structure. When ready, a Run button is pressed that contains the uiresume line:
function pushRun_Callback(hObject, eventdata, handles)% hObject handle to pushRun (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% resume code
uiresume(gcbf);
This executes the code in OutputFcn, which is some variable storage and manipulation, and returns to the main code. The main code runs a Simulink model in a loop, calculating a set of metrics from each run, and then produces a series of plots.
I would then like the user to have the option to press the Run button again, perhaps having adjusted some of the edit box values. However, the callback for the Run button just contains the uiresume command, which is now not paired to a uiwait. How do I call the OpeningFcn function again when the GUI has remained open (as I would like it to be)?
I haven't found reference to this problem anywhere so I'm concerned that it is less about finding the right code than correctly structuring it in the first place.
Thanks,
Simon.
Best Answer