title: calculate standard deviation of daily data within a year
body: <p>I have a question,
  In Matlab, I have a vector of 20 years of daily data (X) and a vector of the relevant dates (DATES). In order to find the mean value of the daily data per year, I use the following script:</p>
  
  <pre><code>A = fints(DATES,X);                          %convert to financial time series
  B = toannual(A,'CalcMethod', 'SimpAvg');     %calculate average value per year
  C = fts2mat(B);                              %Convert fts object to vector
  </code></pre>
  
  <p>C is a vector of 20 values. showing the average value of the daily data for each of the 20 years. So far, so good.. Now I am trying to do the same thing but instead of calculating mean values annually, i need to calculate std annually but it seems there is not such an option with function "toannual".</p>
  
  <p>Any ideas on how to do this?</p>
  
  <p>THANK YOU IN ADVANCE</p>