title: How to get selective rows from a matrix and form a new matrix in octave?
body: <p>Suppose I have a matrix in octave </p>
  
  <pre><code>A = [2 3 5;
       5 6 7; 
       8 9 10;
       1 2 5]
  </code></pre>
  
  <p>Now I want to get only those rows where the last column is say equal to 5. I was wondering if there is a built in function for this, cause right now am doing it like this.</p>
  
  <pre><code>collection = [];
  for i = 1 : size(matrix,1),
      if(matrix(i,3) == 5),
          collection = [collection; matrix(i,:)];
      end
  end
  </code></pre>
  
  <p>I would be fine if there is such a method for single column matrices.</p>