Read in all inputs on a a GUI when I press the RUN pushbutton.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am a newbie with MATLAB GUIs. I have a GUI with multiple inputs (text boxes, radio buttons and check mark selections) and a RUN button to begin execution. How can I get the program to refresh all values from all the current entries in the whole GUI before it starts the execution? When I start the GUI, all entries will be default. I don't want the user to have to "touch" all entries before executing, but only change a few that need to be changed from default. It seems that a Callback function for an entry is called only if the entry in the corresponding field is changed by the user. So, the "unchanged" entries are not read in at all, even when they have valid values in them.
Thanks.
0 comentarios
Respuestas (2)
mbonus
el 2 de Sept. de 2016
Editada: mbonus
el 2 de Sept. de 2016
Create a push button that will take the values from all the other uicontrols and have it pass them into the function. In the callback it will retrieve the values like this
varname = get(hObject,'Value')
you can retrieve hObject, which is the specific uicontrols handle by doing
findobj('tag',objTagString)
Just do this for every value in the pushbuttons callback and then pass them into the function.
Edit: just noticed that you already have a run button so just toss that into its callback
0 comentarios
Manohar Vohra
el 2 de Sept. de 2016
Hi,
In order to use any values placed in the textbox whether it is changed or not, in the 'run' pushbutton callback, you can use the get() function and assign it to a variable.
Please be a little more specific on what do you want to do...
0 comentarios
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!