title: Matlab's bsxfun() code
body: <p>What does this do?</p>
  
  <pre><code>u = [5 6];
  s = [1 1];
  data1    =[randn(10,1) -1*ones(10,1)];
  data2    =[randn(10,1) ones(10,1)];
  data     = [data1; data2];
  deviance = bsxfun(@minus,data,u);  
  deviance = bsxfun(@rdivide,deviance,s); 
  deviance = deviance .^ 2; 
  deviance = bsxfun(@plus,deviance,2*log(abs(s)));
  [dummy,mini] = min(deviance,[],2);
  </code></pre>
  
  <p>Is there an equivalent way of doing this without bsxfun?</p>