File Exchange

image thumbnail

JMatIO - Matlab's MAT-file I/O in JAVA

version 1.0.0.0 (203 KB) by Wojciech Gradkowski
Package contains Matlab's MAT-file I/O API in JAVA. Supports Matlab 5 MAT-flie format reading and wr

6 Downloads

Updated 05 Oct 2007

View License

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

this project is also available at http://sf.net/projects/jmatio

Cite As

Wojciech Gradkowski (2021). JMatIO - Matlab's MAT-file I/O in JAVA (https://www.mathworks.com/matlabcentral/fileexchange/10759-jmatio-matlab-s-mat-file-i-o-in-java), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (16)

Thank you for your improvements Florian Enner.

Florian Enner

I ran into some fundamental issues when trying to save large data sets in a memory constrained environment, and I ended up writing my own library. I've made it available on https://mathworks.com/matlabcentral/fileexchange/70357-mat-file-library in case anyone else has similar needs. It's already full featured and supports all data types.

Sanman Ganthe

Can support for UInt32 be added?

Ned Twigg

Great library, but it hasn't been updated in a while. I am maintaining a binary-compatible fork with some bugfixes and new features here:

https://github.com/diffplug/matfilerw
- added support for 16-bit integers
- robust parsing of Java objects embedded in the MAT-File
- fixed some bugs in equals() and hashCode() implementations
- OSGI metadata
- available on Maven Central as com.diffplug.matsim:matfilerw

Irma

very useful! Thanks

Jayant

How can we save a 3 dimensional array of type MLUInt8? I have the image stored in MWNumericArray format. I am able to create the array of 3 dimensions but I am not able to figure out how to copy the data inside it.

Lee Wei Yeong

E S

how to use this library?

Stuart Bowman

Thank you! This is a big help in the world of java apps that produce data that engineers need to analyze. Great API.

rohit

very useful

Bryant Mairs

Would be useful to support the single data type. Odd omission from this library.

Lei

Execellent. But problem with large mat files. I have these error messages when reading a large mat file ( > 40 M):
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.io.ByteArrayOutputStream.write(Unknown Source)
at com.jmatio.io.MatFileReader.inflate(Unknown Source)
at com.jmatio.io.MatFileReader.readData(Unknown Source)
at com.jmatio.io.MatFileReader.read(Unknown Source)
at com.jmatio.io.MatFileReader.<init>(Unknown Source)
at com.jmatio.io.MatFileReader.<init>(Unknown Source)
at com.Tester.common.Tester.main(Tester.java:41)

Is there a fix?

iskandar mamaik

Olav -

Very useful library

Leon Lee

Very useful!

MATLAB Release Compatibility
Created with R14SP2
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: CSMatIO: MAT-file I/O API for .NET 2.0

Community Treasure Hunt

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

Start Hunting!