title: extract real number from array in matlab
body: <p>I would like to extract only the real numbers from an array containing imaginary numbers also
  I would like to eliminate the imaginary numbers from array. Therefore, from an array of 10 elements, of which 5 real, and 5 imaginary, to obtain an array of only 5 elements, which must be the real numbers element. This in MATLAB</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Adding an example</p>
  
  <pre><code>input_array = [ 1, 1+i, -2+2*j, 3, -4, j ];
  </code></pre>
  
  <p>The desired output would be</p>
  
  <pre><code>output = [ 1, 3, -4 ];
  </code></pre>
  
  <p>which contains only real elements of <code>input_array</code>.</p>