Main Content

Conversion of MATLAB Types to Java Types

When MATLAB Returns:Dimension of Data in MATLAB is:MATLAB Data Converts To Java Type:
int8, uint8{1,1}byte,java.lang.Byte
{1,n} , {n,1}byte[n], java.lang.Byte[n]
{m,n,p,...}byte[m][n][p]... , java.lang.Byte[m][n][p]...
int16, uint16{1,1} short, java.lang.Short
{1,n} , {n,1}short[n], java.lang.Short[n]
{m,n,p,...}short[m][n][p]... , java.lang.Short[m][n][p]...
int32, uint32{1,1}int, java.lang.Integer
{1,n} , {n,1}int[n], java.lang.Integer[n]
{m,n,p,...}int[m][n][p]... , java.lang.Integer[m][n][p]...
int64, uint64{1,1}long, java.lang.Long
{1,n} , {n,1}long[n], java.lang.Long[n]
{m,n,p,...}long[m][n][p]... , java.lang.Long[m][n][p]...
single{1,1}float, java.lang.Float
{1,n} , {n,1}float[n], java.lang.Float[n]
{m,n,p,...}float[m][n][p]... , java.lang.Float[m][n][p]...
double{1,1}double, java.lang.Double
{1,n} , {n,1}double[n], java.lang.Double[n]
{m,n,p,...}double[m][n][p]... , java.lang.Double[m][n][p]...
logical{1,1}boolean, java.lang.Boolean
{1,n} , {n,1}boolean[n], java.lang.Boolean[n]
{m,n,p,...}boolean[m][n][p]... , java.lang.Boolean[m][n][p]...
char{1,1}char, java.lang.Character
{1,n} , {n,1}java.lang.String
{m,n,p,...}char[m][n][p]... , java.lang.Character[m][n][p]...
cell (containing only strings){1,1}java.lang.String
{1,n} , {n,1}java.lang.String[n]
{m,n,p,...}java.lang.String[m][n][p]...
cell (containing multiple types){1,1}java.lang.Object
{1,n} , {n,1}java.lang.Object[n]
{m,n,p,...}java.lang.Object[m][n][p]...