title: Java LinkedList to matlab array
body: <p>In one of the answers to <a href="https://stackoverflow.com/questions/1413860/matlab-linked-list">MATLAB linked list</a> the responder suggests using java linked lists, which seems like an excellent solution, but it is not clear what an elegant way is to convert the linkedlist (once constructed) to a matlab cell array (I guess one have a for loop, but that seems a little clunky...</p>
  
  <p><strong>EDIT</strong>  looks like cell(foo) converts a java array into a matlab array, but that's not quite the same thing...
  <strong>EDIT</strong> Enlightenment strikes. If <code>a</code> is the LinkedList, then </p>
  
  <pre><code>cell(a.toArray(a))
  </code></pre>
  
  <p>does the trick.</p>