title: Parfor on a cluster : failure to recognize a function
body: <p>I try to run a simple task on different machines of a cluster.
  My configuration has been validated (it's ok). When I run the code
  on the 'local' configuration, it works. But when I use the cluster
  configuration, I get the following error :</p>
  
  <p>Error using parallel_function (line 598)
  Undefined function 'lafunc' for input arguments of type 'double'.
  Error Stack : (No remote error stack)
  Error in petittest (line 6)  --» (petittest is my program's name)
  parfor it=1:200</p>
  
  <p>I try to modify the code to use "dfeval" instead of the parfor loop,
  but I got the same kind of result (unrecognize function lafunc).</p>
  
  <p>How do I get the other workers in the cluster to recognize the function
  lafunc that I manually defined ?</p>
  
  <p>The code is the following:</p>
  
  <pre><code>%%%%%%%%%%%%%
  laconfig='/home/matlab/fred/LACED_DC1.mat';
  setmcruserdata('ParallelConfigurationFile',laconfig);
  
  matlabpool open
  
  parfor it=1:200
  
  yo=lafunc(it);
  disp(yo)
  
  end
  
  matlabpool close
  
  %%%%%%%%%%%
  </code></pre>
  
  <p>where the lafunc function is</p>
  
  <pre><code>%%%%%%%%%%%%%%
  
  function [y]=lafunc(x)
  y=x*x;
  end
  
  %%%%%%%%%%%%%%%%%%%%%%
  </code></pre>
  
  <p>Thanks a lot, every piece of info is useful to me!!</p>