title: How can I access nested cell arrays in MATLAB?
body: <p>I would like to make a nested cell array as follows:</p>
  
  <pre><code>tag = {'slot1'}
  info = {' name' 'number' 'IDnum'}
  x = {tag , info}
  </code></pre>
  
  <p>And I want to be able to call <code>x(tag(1))</code> and have it display <code>'slot1'</code>. Instead I am getting this error:</p>
  
  <pre><code>??? Error using ==&gt; subsindex
  Function 'subsindex' is not defined for values of class 'cell'.
  </code></pre>
  
  <p>If I call <code>x(1)</code> MATLAB displays <code>{1x1 cell}</code>. I want to be able to access the first cell in the list <code>x</code> so I can do a string comparison with another string.</p>
  
  <p>I know I can write my own class to do this if MATLAB's built in class does not work but is there a simple trick to solve this problem?</p>