Running two MATLAB programs at the same time
Mostra commenti meno recenti
Hi, I have a function in Matlab which depends on an input N. I need to run function(2),function(3),function(4),function(5) and perhaps also try other values of N. Each of these runs takes about two hours. I could run one after the other, but it would be much more efficient if I could just run them at the same time. Each run is independent of the other, so this should be doable, right?. I want to do the same one does when one runs a script in bash with nohup ./script.sh &, so you can send other scripts. How can I do this in Matlab?
Thanks
Risposta accettata
Più risposte (1)
Walter Roberson
il 16 Ott 2017
1 voto
You can use the Parallel Computing Toolbox, with batch() or parfeval()
Note: unless you configure specially, each worker would have access to one physical core. That can be a problem if your routines do a lot of mathematical calculations with large arrays: such calls are normally sent to an optimized library that automatically uses multiple threads. If this applies to your program, then running in parallel can end up taking longer than running individually.
Categorie
Scopri di più su Entering Commands in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!