Can a GUI timer be made to regularly update during long calculations?
3 次查看(过去 30 天)
显示 更早的评论
I have a GUI that runs a program that takes anywhere between a few minutes and a few hours to run and I would like to add a timer to the GUI so I can see how long the program has been running since it started. The program spends the majority of its time in the Symbolic Math Toolbox (~90%), and there are no significant portions of time spent in a loop during execution.
In order to accomplish this (in a way that updates regularly without slowing the original program down), I believe the Parallel Computing Toolbox would have to be utilized, but I don't have any experience with this.
Is there anyone here that might know how this could be accomplished, or if it's even possible?
0 个评论
采纳的回答
Sean de Wolski
2013-1-4
Hi Tim,
You could use a timer on the main thread and then use batch() (from PCT) to run the feval() command on a worker(s) that was opened with matlabpool()
更多回答(1 个)
Loren Dean
2013-1-4
The timer object in MATLAB (>> help timer) is probably your best bet. Just initialize it when the GUI launches or the program starts and then have it callback to display the runtime.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!