title: Calculating standard deviation using data points and count vector in Matlab
body: <p>I want to use Matlab to calculate the standard deviation of a population I have compiled.</p>
  
  <p>The matlab function takes as input one large population vector and outputs the standard dev.</p>
  
  <p>However, for optimisation purposes, instead of one large vector, I have a set of individual data points, and the number of times each point is used.</p>
  
  <p>I could use a loop and create a huge population vector, but it's not ideal.</p>
  
  <p>How could I go about this?</p>