title: MATLAB: Select all of an array EXCEPT in given ranges
body: <p>I'd like to perform metrics on the contents of an array that do NOT fall within certain ranges.</p>
  
  <p>For example, I have an array with 1000 rows and 2 columns. I'd like to perform a mean() calculation on all the elements in one column (let's say column #2) that don't fall in rows 50-150, 250-300, 400-700 and 900-950.</p>
  
  <p>Thus, the mean should be calculated based on rows 1-49, 151-249, 301-399, 701-899 and 951-1000.</p>
  
  <p>Any ideas how to go about this?</p>
  
  <p>Edit: I should point out that those items which are included will change each time the program is run. Therefore, I can't just hard-code the inclusions in; they need to be worked out based on the exclusions.</p>