title: Statistical outlier detection in MATLAB
body: <p>Suppose that we have this matrix :</p>
  
  <pre><code>main = [10000   5   3   1;
  5   5677    0   134;
  1   1   456 3];
  </code></pre>
  
  <p>This method the most widely used method in econometrics and statistical problems.<code>X</code> is our data that we're searching for outliers in it.</p>
  
  <pre><code>X-mean(X)&gt;= n*std(X)
  </code></pre>
  
  <p>So If this Inequality was true, That sample is outlier otherwise We will keep the sample.</p>
  
  <p>Now my question. I want find outliers with these codes:</p>
  
  <pre><code>meann = mean(main);
  stdd = std(main);
  out = find(main-repmat(meann,size(main,1),1)&gt;=repmat(2*stdd,size(main,1),1));
  </code></pre>
  
  <p>We are searching outliers in every column. <code>Out</code> should indicate index of outliers. In final step We should remove outliers in every column. Is any simpler function or method to do this in MAtLAB?</p>
  
  <p>Thanks.</p>