Is there a simple way to spawn a copy of your current MATLAB workspace into a new process/thread?
3 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Jan
on 10 Apr 2017
Edited: Jan
on 10 Apr 2017
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 Comments
More Answers (1)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!