Is there a simple way to spawn a copy of your current MATLAB workspace into a new process/thread?
3 次查看(过去 30 天)
显示 更早的评论
If not, is there an unnecessarily complex way to do it? ;)
I've written some code that creates plots from EEG time series data (stored in the workspace). The user navigates between the plots using the keyboard, and this lets them see/compare features between the plots.
The only problem is that it blocks the main thread. Running it in a separate thread would be ideal, but it seems like 'batch' doesn't show plots - and it's slow!
system('matlab') works in creating a new process, but the workspace is empty. It's also quite slow.
Is there a simple way to initialise a new process/thread, with my current workspace, so that I can run the plotting script without blocking execution?
Thanks, ~Chris
0 个评论
采纳的回答
Jan
2017-4-10
编辑:Jan
2017-4-10
What does block the main thread? If you have a bunch of GUIs, the callbacks are processed on demand only. As long as there are no waitfor commands or modal dialogs, nothing is blocked.
A save() command saves all variables in the current workspace to the disk. With load() they can be reloaded in another thread. But I assume, that this indirection is a bad idea. Better create a non-blocking interface.
0 个评论
更多回答(1 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!