title: matlab: finding indices of values common for two matrices
body: <p>I have a simple question. </p>
  
  <p>lets say we have two arrays:</p>
  
  <pre><code>data = [1 1 2 2 2 2 3 3 3 4 4 4 4 4 5 5 5 5 6 6 6];
  A = [1 3 6];
  </code></pre>
  
  <p>I want to have indices of values from data which are equal to any value from A. </p>
  
  <p>i.e. answer for that will be: 1, 2, 7, 8, 9, 19, 20, 21</p>
  
  <p>How to do it without using for loop and scanning each value from A one by one..?
  Thanks!
  Art. </p>