how to pass java collection to matlab

1 Ansicht (letzte 30 Tage)
Jason Novotny
Jason Novotny am 9 Aug. 2016
Beantwortet: Malcolm Lidierth am 11 Aug. 2016
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

Antworten (1)

Malcolm Lidierth
Malcolm Lidierth am 11 Aug. 2016
Probably simplest to use an array
myArray=foos.toArray();
myArray will be a java array of type Object.

Kategorien

Mehr zu Call Java from MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by