Multiprocessing

parfor loop

For parallel processing, use parfor instead of a normal for loop


   matlabpool open 4       %  use max 4 processors in parallel
     parfor i=1:8          %  use parfor like a normal for loop
       result(i) = sin(i); %  do something, e.g.,  call a function for each element i
     end
   matlabpool close        %  close parallel processes


Close all running jobs

matlabpool close force local