title: Parallel Processing in MATLAB with more than 12 cores
body: <p>I created a function to compute the correct number of ks for a dataset using the Gap Statistics algorithm. This algorithm requires at one point to compute the dispersion (i.e., the sum of the distances between every point and its centroid) for, let's say, 100 different datasets (called "test data(set)" or "reference data(set)"). Since these operations are independent I want to parallel them across all the cores. I have the Mathworks' Parallel Toolbox but I am not sure how to use it (problem 1; I can use past threads to understand this, I guess). However, my real problem is another one: this toolbox seems to allow the usage of just 12 cores (problem 2). My machine has 64 cores and I need to use all of them. Do you know how to parallel a process among 12+ cores?</p>
  
  <p>For your information this is the bit of code that should run in parallel:</p>
  
  <pre><code>%This cycle is repeated n_tests times where n_tests is equal
  %to the number of reference datasets we want to use
  for id_test = 2:n_tests+1
  
  test_data = generate_test_data(data);
  
  %% Calculate the dispersion(s) for the generated dataset(s)
  
  dispersions(id_test, 1:1:max_k) = zeros;
  
  %We calculate the dispersion for the id_test reference dataset
  for id_k = 1:1:max_k
      dispersions(id_test, id_k) = calculate_dispersion(test_data, id_k);
  end
  end
  </code></pre>