I want to store some data generated via Matlab and want to access it from Java code bas开发者_运维问答e for further processing. Please let me know how I can do it ?
JMatIO - Matlab's MAT-file I/O in Java
JMatIO is a JAVA library to read/write/manipulate with Matlab's binary MAT-files.
Currently supported data types are:
+ Double array
+ UInt8, Int8 array
+ UInt64, Int64 array
+ Char array
+ Structure
+ Cell array
+ Sparase array
What kind of data? If you have a plain old 2-D matrix in Matlab, it can be passed directly as a double[][]
argument to a Java method.
See the MATLAB documentation on passing data to a Java method. Note that a MATLAB struct
cannot be passed to Java directly.
If your Java code requires method arguments that are something standard like a List
or a Map
, you can create an ArrayList
or HashMap
from within MATLAB:
>> m = java.util.HashMap;
>> m.put('foo',3);
>> m.put('bar',4);
>> m
m =
{foo=3.0, bar=4.0}
matlabcontrol
matlabcontrol is a Java API that allows for calling MATLAB from Java. You can eval, feval, as well as get and set variables. Interaction can be performed from either inside MATLAB or outside MATLAB.
Export Data from Matlab to Text Files
精彩评论