Reputation: 31
I am trying to convert a uint16
Matlab matrix (size: 1109-by-1024) into a Java short[][]
using the jmatio library. Following is the code:
String name = "array_re";
String fileName = "microsec.mat";
MatFileReader matfilereader = new MatFileReader( fileName );
short[][] mlArrayShort = ((MLInt16) matfilereader.getMLArray( name
)).getArray();
However, at the third line, I am getting the following error:
"com.jmatio.io.MatlabIOException: Incorrect matlab array class: uint16".
Does anyone know how to resolve this?
Upvotes: 0
Views: 205
Reputation: 31
Thank you so much for your answers. Yes the problem was that Java does not handle unsigned data types. I converted the matrix from Matlab to signedint16 and read it in Java successfully using the same above code.
Upvotes: 0