How to resume the program runing after a button press ?
3 次查看(过去 30 天)
显示 更早的评论
Hi !
I have a program script that opens a GUI. the user should press one of many buttons. and the value of a global variable will change depending on which button was pressed. then in the scribt that value will be used. the process will be repeated many times.
what happen now is after pressing the button I have to close the GUI for the rest of the program to run. so, I need a way to open the GUI once and for the rest of the program to run once one button is pressed.
the thing is I am so beginner in the whole GUI thing so I may need more detail or what exact function to use and where
thank you.
5 个评论
Guillaume
2017-8-22
编辑:Guillaume
2017-8-22
@Nora,
There certainly are better mechanisms than global variables to pass data between programs.
With regards to your question, your design is not entirely clear. Showing us the code would help clarify. It sounds like you have two pieces of code that you want to run in parallel, a script and a GUI. If that is the case, then that is not possible in matlab. You would indeed need to close the GUI to continue the script. To achieve something similar to what you want you'll need to move the script code within the GUI code.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!