title: How to calculate the centroid of a matrix?
body: <p>I have the following 5x5 Matrix A:</p>
  
  <pre><code>1 0 0 0 0 
  1 1 1 0 0 
  1 0 1 0 1 
  0 0 1 1 1 
  0 0 0 0 1
  </code></pre>
  
  <p>I am trying to find the centroid in MATLAB so I can find the scatter matrix with:</p>
  
  <pre><code>Scatter = A*Centroid*A'
  </code></pre>