title: Find indices of elements in an array based on a search from another array
body: <p>Imagine that i have two arrays:</p>
  
  <pre><code>a = [1, 2, 5, 7, 6, 9, 8, 3, 4, 7, 0];
  
  b = [5, 9, 6];
  </code></pre>
  
  <p>I want to find the indices of the values of b in a (only the first hit) ie:</p>
  
  <pre><code>c = [3, 6, 5];
  </code></pre>
  
  <p>Is there an easy Matlab native way to do this without looping and searching.</p>
  
  <p>I have tried to use find() with:</p>
  
  <pre><code>find(a == b)
  </code></pre>
  
  <p>and it would work if you did this:</p>
  
  <pre><code>for i = 1:length(b)
      index = find(a == b(i));
      c = [c, index(1)]
  end
  </code></pre>
  
  <p>But it would be ideal for it to be easier then this. </p>