In a script(outside of GUI), how to execute button callback function in GUI?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, all. I have a GUI program(named myGUI) created by guide(). There are several checkboxes and a button which is used to calculate a measure value and then save it to the file according to the two GUI input values and the status of checkboxes. This button function sometimes takes a long time to finish calculation. In order to choose the optimal value of this measure, I want to use this GUI within a loop.
The script is as follows:
--------------------------
A % Known row vector
B % Known row vector
for i = 1:10
myGUI(A(i), B(i)); % Here, I want to execute the button function in myGUI.
end
---------------------------------------------------------------------
My question is :
1) how to execute the button function of myGUI within the loop?
2) how to decide the status whether myGUI finish its final calculation,
Thanks for any help.
0 comentarios
Respuestas (2)
Jan
el 13 de Dic. de 2012
A good programming style is to move the calculations in a separate function, which is called from the callback, but is available from outside the GUI also. Then you can run the operations from the GUI or in "batch-mode" programmatically.
Using the indirection to call the calculations through calling the GUI is less flexible and more complicated.
The general rul is: Keep the data, the calculations and the GUI separately as consequent as possible. Such a modular concept allows e.g. for modifying the GUI without touching the calculations, and vice versa.
0 comentarios
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!