how to pass java collection to matlab
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi, I hava a fairly simple Java POJO that contains 4 fields- to of type String two Double, let's call it Foo. I want to pass a list of Foo to Matlab
List<Foo> foos;
matlabFunction(foos)
How or hat is the best way to accomplish this? I was looking at MWJavaObjectRef but not quite sure I understand. Any simple bit of code would help.
Thanks, Jason
댓글 수: 0
답변 (1개)
Malcolm Lidierth
2016년 8월 11일
Probably simplest to use an array
myArray=foos.toArray();
myArray will be a java array of type Object.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Java from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!