In Matlab, how can I run 2 separate programs simultaneously, each turned on and off by separate buttons.
1 次查看(过去 30 天)
显示 更早的评论
For example, I have Program 1 & Program 2, when I run commandPrograms program it will open up two buttons. One button will turn on and off Program 1, and the other Program 2. I can turn on and off each one separately.
All programs in Matlab.
0 个评论
回答(1 个)
Walter Roberson
2023-4-1
WIth relatively new versions of MATLAB, you might be able to take advantage of backgroundPool and parfeval the functions. parfeval() returns a future; you can have callbacks cancel futures.
Note however, that background pools are restricted in the features they can use. There are more features available if you have Parallel Computing Toolbox and use parpool and parfeval (technically a different function than the previously mentioned one)
But either way, background pool or parallel pool, tasks created in this way cannot directly interact with graphics that are visible on the screen. They can create graphics and capture frames in the created graphics, but they cannot themselves display anything visible to the user, and cannot ask the user for input.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!