5

In one of the answers to MATLAB linked list 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...

EDIT looks like cell(foo) converts a java array into a matlab array, but that's not quite the same thing... EDIT Enlightenment strikes. If a is the LinkedList, then

cell(a.toArray(a))

does the trick.

1
  • 4
    Could you please add your "enlightenment" as an answer? Commented Jul 15, 2011 at 20:30

1 Answer 1

5

By popular demand, adding this as an answer: cell(a.toArray(a)) does what I need.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.