title: Derive Matlab value matrix from Matlab key matrix and lookup vector
body: <p>I have a Matlab object of integer keys in the range 1:1:7 e.g.</p>
  
  <pre><code>[3, 1, 4, 5, 6]
  </code></pre>
  
  <p>I also have a size 7 vector containing an associated value for each integer key, e.g.</p>
  
  <pre><code>vals = (10, 20, 30, 4000, 50, 60, 70)
  </code></pre>
  
  <p>what is the most efficient way to create a matrix of the values using the keys as indices, e.g. a matrix</p>
  
  <pre><code>[30, 10, 4000, 50, 60]
  </code></pre>
  
  <p>(in reality the key object is 6D). Must I loop?</p>