title: MATLAB: SQL-style join operation
body: <p>I would like to do an SQL-style join with Matlab. I could do it by creating datasets (stats toolbox), doing the join, converting back and deleting the datasets again:</p>
  
  <pre><code>A1 = [10 10 20 20 30 30 50 50]';
  B1 = (10:10:70)';
  B2 = (1:7)';
  
  dsA = dataset({A1, 'Key'});
  dsB = dataset({B1, 'Key'}, {B2, 'Idx'});
  dsA = join(dsA, dsB, 'key', 'Key');
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>Key    Idx
  10     1  
  10     1  
  20     2  
  20     2  
  30     3  
  30     3  
  50     5  
  50     5  
  </code></pre>
  
  <p>My Question: Is there another way of doing this, <em>without using datasets and without for loops</em>?</p>
  
  <p>Thanks a lot for any help!</p>