title: Matlab Transparency violation error while the code is correct
body: <p>I am using the Matlab parallel toolbox to do parallel computing. I've doubled check the variable definition of the code, and it follows the requirements of parfor command. However, Matlab still told me that "Transparency Violation Error," could you help me figure out this issue? </p>
  
  <p>Here is the source code. Thank you so much.</p>
  
  <pre><code>load Wind80.mat
  Wspeed_80 = Wind80;
  TotalLoc = 4000;
  Nloc = 5; % no of loc of each run
  maxrun = ceil(TotalLoc/Nloc);
  StrInfo.Pstr = 1; 
  StrInfo.Tstr = 0:4:72;
  tic
  parfor run = 1:maxrun
     WT1 = [];
     WT2 = [];
     [WT1, WT2] = CompWTGenFun(run, Nloc, TotalLoc, StrInfo);
     filenm = ['ResultPara' num2str(StrInfo.Pstr) 'Run' num2str(run) '.mat' ];
     save(filenm, 'WT1', 'WT2', '-mat');
     clear WT1 WT2
  end
  toc
  </code></pre>