The following table lists the data conversion rules for converting Java® data types to MATLAB® types.
The conversion rules apply to scalars, vectors, matrices, and multidimensional arrays of the types listed.
The conversion rules apply not only when calling your own methods,
but also when calling constructors and factory methods belonging to
the MWArray
classes.
When calling an MWArray
class method constructor,
supplying a specific data type causes the compiler to convert to that
type instead of the default.
Java to MATLAB Conversion Rules
Java Type | MATLAB Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NoteSubclasses of |
|
|
|
|
|
NoteA Java string is converted to a An array of Java strings ( Higher dimensional arrays of In general, an |
The following table lists the data conversion rules for converting MATLAB data types to Java types.
The conversion rules apply to scalars, vectors, matrices, and multidimensional arrays of the types listed.
MATLAB to Java Conversion Rules
MATLAB Type | Java Type (Primitive) | Java Type (Object) |
---|---|---|
cell | Not applicable |
NoteCell arrays are constructed and accessed as arrays of
|
structure | Not applicable |
NoteStructure arrays are constructed and accessed as arrays of
|
char | char | java.lang.Character |
double | double | java.lang.Double |
single | float | java.lang.Float |
int8 | byte | java.lang.Byte |
int16 | short |
|
int32 | int | java.lang.Integer |
int64 | long | java.lang.Long |
uint8 | byte |
Java has no unsigned type to represent the
|
uint16 |
|
Java has no unsigned type to represent the
|
uint32 | int |
Java has no unsigned type to represent the
|
uint64 | long |
Java has no unsigned type to represent the
|
logical | boolean | java.lang.Boolean |
Function handle | Not supported | |
Java class | Not supported | |
User class | Not supported |
Java has no unsigned types to represent the uint8
, uint16
, uint32
,
and uint64
types used in MATLAB. Construction
of and access to MATLAB arrays of an unsigned type requires conversion.