title: Random number generator in parallel computing (MATLAB), different initial random numbers in every parallel loop?
body: <p>Suppose that I have this code in MATLAB:</p>
  
  <pre><code>% Predefined data
  SX = [1, 2, 3, 4];
      parfor xx = 1:4
          naming2 = SX(xx);
          [BestM, BestX{xx},  fina_M{xx}, final_D{xx}, BestAA{xx}, final_Data{xx}] = Optmz(naming2,  v_data); 
      end
  </code></pre>
  
  <p><code>Optmz</code> is an optimization algorithm. This optimization algorithm should run to optimize a regression model (with different output and optimized inputs-feature selection). As you know heuristic optimization algorithms are based on random numbers. We have different initial random numbers in every <code>parlor</code> loop? Is this a proper structure to decrease time of my application? I'm currently using <code>for</code> loop in above structure.</p>
  
  <p>This is a part of printed output. Iterations are not sorted. Any problem? Based on above code we should have four iterations with same number. I need total different calculations in all 4 workers with different initial random number generator. For example, like the way we run our calculations in sequence without parallel computing. Run first one, second one, third one and finally fourth one.</p>
  
  <pre><code>******Iteration 24,   Best Cost = 0.041201******
  ******Iteration 26,   Best Cost = 0.034994******
  ******Iteration 26,   Best Cost = 0.036624******
  ******Iteration 26,   Best Cost = 0.039317******
  ******Iteration 25,   Best Cost = 0.039584******
  ******Iteration 27,   Best Cost = 0.034994******
  ******Iteration 27,   Best Cost = 0.036624******
  ******Iteration 27,   Best Cost = 0.039317******
  ******Iteration 28,   Best Cost = 0.034994******
  ******Iteration 26,   Best Cost = 0.039242******
  ******Iteration 28,   Best Cost = 0.036624******
  ******Iteration 28,   Best Cost = 0.03931******
  ******Iteration 29,   Best Cost = 0.034994******
  ******Iteration 29,   Best Cost = 0.036624******
  ******Iteration 27,   Best Cost = 0.039048******
  ******Iteration 29,   Best Cost = 0.03931******
  ******Iteration 30,   Best Cost = 0.034994******
  ******Iteration 30,   Best Cost = 0.036624******
  ******Iteration 28,   Best Cost = 0.039048******
  </code></pre>