title: How to use an entry in an array to call a different array entry
body: <p>I've looked at a few other questions but I couldn't come up with an answer, I'm relatively new to MatLab (but not programming) so I apologize if it's a duplicate.</p>
  
  <p>I'm sure the title isn't very clear so here's an example:</p>
  
  <p>I have an array, say <code>name = ['Jack';'Jill'];</code>. The elements in this array reference other arrays, such as:</p>
  
  <pre><code>Jack.income = 31000;
  Jack.car = 1;
  Jill.income = 55000;
  Jill.car = 0;
  </code></pre>
  
  <p>Now, I would like to use <code>name</code> to pull data from the other arrays, such as:</p>
  
  <p><code>data = name(1).income</code>, which should return <code>31000</code>, or <code>data = name(2).car</code>, which should return <code>0</code>.</p>
  
  <p>Any help on this would be greatly appreciated.</p>
  
  <p>Thank you very much,</p>
  
  <p>Eric</p>