parallel processing - Run a script that uses multiple MATLAB sessions -


how call function simple inputs in several matlab sessions automatically?

the manual way be:

  • open 3 sessions
  • call magic(t) t 1, 2 or 3 respectively

so, question is: how can programatically?

in case relevant, not want use parallel processing toolbox.


note don't think parfor loop can want. first of require parallel processing toolbox, , secondly want able debug 1 of these operations fails, without bothering other sessions.

first of way must found open sessions programatically. based on this , this found can follows (works on windows well):

% opening 3 matlab sessions t = 1:3 !matlab & end 

besides opening them, simple command can given

!matlab -r "magic(5)" & 

now, combine small trick remains:

for t = 1:3    str = ['!matlab -r "magic(' num2str(t) ')" &'];    eval(str) end 

note if want use more complicated inputs can save them in struct , call them index using wrapper script called function.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -