title: Find mean values in for-loop over distributed range
body: <p>I have a data like below:</p>
  
  <pre><code>49.6    46.1
  49.65   46.3
  50.1    47.03
  50.2    47.06
  51.35   46.027
  51.36   46.20
  </code></pre>
  
  <p>I want to find the mean values of both column based on specific range of first column. for example in range of [49-50) I should calculate the mean values of the first column and  mean of corresponding values in the second column. In this example the sub-array (first column only) with numbers </p>
  
  <pre><code>49.6    
  49.65   
  </code></pre>
  
  <p>will be in range of [49-50) so I want to find the mean value for them and the mean value of the corresponding values in the 2nd column.</p>
  
  <p>The range would be like <code>49:1:100</code>. The code below doesn't work properly.</p>
  
  <pre><code>for i=49:1:100
      meanWithinRange(i) = mean(data(i,1));
  end
  </code></pre>