title: Efficient way to calculate mean for huge data in MATLAB
body: <p>I have an output from previous simulation where it has 32872 row and 1000 column. the row represents daily data for 90 years while the column represents different data sets for 90 years. What i want to do is calculate the mean and standard deviation for every year separately. For example what i am doing is :</p>
  
  <pre><code>%for year 1
  a=mean2(RAINFALL(1:365,:));
  b=std2(RAINFALL(1:365,:));
  
  %for year 2
  a=mean2(RAINFALL(366:730,:));
  b=std2(RAINFALL(366:730,:));
  .
  .
  .
  .
  %for year 90
  a=mean2(RAINFALL(32508:32872,:));
  b=std2(RAINFALL(32508:32872,:));
  </code></pre>
  
  <p>What i did was i calculate manually each year so i have to do it manually for about 90 times. the problem is i have about 100 of data sets like this. Is there anyway that i can perform this via automatically or using loop or other any function in MATLAB to simplify this process and store the output data in one matrix such as:</p>
  
  <p><img src="https://i.stack.imgur.com/dme6p.png" alt="enter image description here"></p>
  
  <p>so that i don't have to do it manually? I am new to MATLAB programming and hope that experts in MATLAB can suggest me idea how to solve this efficiently. i really appreciate your help because this is for my masters dissertation project. 
   Thank You</p>