The jsmat package and subpackages contain classes to write MATLAB .mat files in a memory efficient manner. Many implementations are based on the JMatIO library (see com.jmatio.* packages).

To write matlab files or output, an {@link ch.javasoft.jsmat.MatFileWriter MatFileWriter} or {@link ch.javasoft.jsmat.MatOutputStreamWriter MatOutputStreamWriter} is used. Both classes support writing {@link ch.javasoft.jsmat.variable.MatAllocated MatAllocated} and {@link ch.javasoft.jsmat.variable.MatReserved MatReserved} variables. MatAllocated variables contain data which is already allocated in memory. It is the most convenient way to write data to the .mat file. However, for very large data structures, such as matrices with millions of rows or columns, it might be more appropriate to write the values to the file in a stream-like manner. When a reserved variable is constructed, only the size must be known. The data is then appended step by step — depending on the underlying function generating the data.

References

  1. JMatIO — Matlab's MAT-file I/O in JAVA at mathworks.com
  2. JMatIO — Matlab's MAT-file I/O in JAVA at sourceforge.net