title: Finding whether a value is equal to the value of any array element in MATLAB
body: <p>Can anyone tell me if there is a way (in MATLAB) to check whether a certain value is equal to any of the values stored within another array?</p>
  
  <p>The way I intend to use it is to check whether an element index in one matrix is equal to the values stored in another array (where the stored values are the indices of the elements which meet a certain criteria).</p>
  
  <p>So, if the indices of the elements which meet the criteria are stored in the matrix below:</p>
  
  <pre><code>criteriacheck = [3 5 6 8 20];
  </code></pre>
  
  <p>Going through the main array (called <code>array</code>) and checking if the index matches:</p>
  
  <pre><code>for i = 1:numel(array)
    if i == 'Any value stored in criteriacheck'
      %# "Do this"
    end
  end
  </code></pre>
  
  <p>Does anyone have an idea of how I might go about this?</p>