title: SPMD vs. Parfor
body: <p>I'm new about parallel computing in matlab. I have a function which creates a classifiers (SVM) and I'd like to test it with several dataset. I've got a 2 core workstation so I'd like to run test in parallel. Can someone explain me the difference between:
  </p>
  
  <pre class="lang-ml prettyprint-override"><code> dataset_array={dataset1, dataset2}
   matlabpool open 2
   spmd
        my_function(dataset(labindex));
   end
  </code></pre>
  
  <p>and</p>
  
  <pre class="lang-ml prettyprint-override"><code> dataset_array={dataset1, dataset2}
   matlabpool open 2
   parfor i:1=2
        my_function(dataset(i));
   end
  </code></pre>