Conversion of Java Types to MATLAB Types
Pass Data from Java to MATLAB Production Server
When you pass data as input arguments to deployed MATLAB® functions from Java®, MATLAB Production Server™ converts the data into equivalent MATLAB data types.
Value Passed to Java Method | Input type Received by MATLAB | Dimension of Data in MATLAB |
---|---|---|
| int8 | {1,1} |
| {1, data.length } | |
| int16 | {1,1} |
| {1, data.length } | |
| int32 | {1,1} |
| {1, data.length } | |
| int64 | {1,1} |
| {1, data.length } | |
| single | {1,1} |
| {1, data.length } | |
| double | {1,1} |
| {1, data.length } | |
| logical | {1,1} |
| {1, data.length } | |
| char | {1,1} |
| {1, data.length } | |
| {1, data.length ()} | |
| cell | {1, data.length } |
| {1, data.length } | |
| MATLAB type for T
| { data.length ,
dimensions (T [0 ])
}, if T is an array |
{ 1, data.length }, if T
is not an array |
Pass Data from MATLAB Production Server to Java
When deployed MATLAB functions return output arguments, MATLAB Production Server converts the data into equivalent Java data types.
MATLAB Output Argument Data Type | Dimension of Data in MATLAB | Resulting Java Data 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 ]... |