Reputation: 51
I have a little GUI, built with the MATLAB guide. It has a few edit text, where i set the values of my parameters. After clicking the "run" button at the bottom, a function should be called with the parameters, that are set in those edit texts. What is the easiest way to do that? Im not sure about accessing the data.
Thanks a lot for your help!
Greets, R93
Upvotes: 0
Views: 322
Reputation: 51
I found out that i could set it with
maxRPM = str2double(get(hObject,'String'));
set(handles.editMaxRPM, 'Double', maxRPM);
Upvotes: 0
Reputation: 14371
MATLAB will generate a callback function for your "run" button in the m-file of your GUI:
function yourpushbutton_Callback(hObject, eventdata, handles)
where handles
is a structure containing all handles of the GUI. You can get the parameters from the edit text
fields and call your function in this callback function. To get the text, use
text = get(handles.edittext1,'String');
Upvotes: 1