File Exchange

image thumbnail

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

version (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


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

Cite As

Wojciech Gradkowski (2021). 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 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:
- 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


very useful! Thanks


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


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.


very useful

Bryant Mairs

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


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 Source)
at Source)
at Source)
at Source)
at<init>(Unknown Source)
at<init>(Unknown Source)
at com.Tester.common.Tester.main(

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

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!