Hi,
I am trying to read inputs from a basic GUI made in GUIDE, save them as doubles, then use them in subsequent analysis. I can't seem to use the defined inputs in my main file with error: Undefined function or variable 'dt'.
Fairly new to MatLAB and my first GUI. My code is currently:
% --- Executes on button press in RUN.
function RUN_Callback(hObject, eventdata, handles)% hObject handle to RUN (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Save Handles
guidata(hObject,handles);% Save Inputs
service_period = str2double(get(handles.Service_Period, 'String'))no_of_runs = str2double(get(handles.no_of_runs,'String'))dt = str2double(get(handles.dt, 'String'))% Change run button to running
set(handles.RUN, 'String', 'Running')% Run analysis
runBen3
Any ideas what I'm doing wrong?
Thanks
Ben
Best Answer