简体   繁体   English

Java LinkedList 到 matlab 数组

[英]Java LinkedList to matlab array

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...MATLAB 链表的答案之一中,响应者建议使用 java 链表,这似乎是一个很好的解决方案,但尚不清楚将链表(一旦构造)转换为 ZC41DA48DFBCAC32DC6C1DAI7F一个有一个for循环,但这似乎有点笨拙......

EDIT looks like cell(foo) converts a java array into a matlab array, but that's not quite the same thing... EDIT Enlightenment strikes. EDIT看起来像 cell(foo) 将 java 数组转换为 matlab 数组,但这并不完全相同......编辑启蒙运动。 If a is the LinkedList, then如果a是 LinkedList,则

cell(a.toArray(a))

does the trick.成功了。

By popular demand, adding this as an answer: cell(a.toArray(a)) does what I need.根据大众的需求,将其添加为答案: cell(a.toArray(a))我的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM