JSON Representation of MATLAB Data Types
JavaScript Object Notation or JSON is a text-based data interchange format that can be used across programming languages. Since JSON is independent of programming language, you can represent MATLAB® data types in JSON. Using the JSON representation of MATLAB data types, you can
Represent data or variables in the client code to serve as inputs to the MATLAB function deployed on the server.
Parse the response from a MATLAB Production Server™ instance for further manipulation in the client code.
The response from the server contains a JSON array, where each
element of the array corresponds to an output of the deployed MATLAB function represented as a JSON object.
You can represent MATLAB data types in JSON using two notation formats: small and large.
Small notation provides a simplified representation of MATLAB data types in JSON. There is a one-to-one mapping between MATLAB data types and their corresponding JSON representation. You can use small notation to represent scalar and multidimensional
doubleandlogicaldata types, scalar and 1-by-Nchardata type and scalarstruct.Large notation provides a generic representation of MATLAB data types in JSON. The large format uses the JSON
objectnotation consisting of property name-value pairs to represent data. You can use large notation for any MATLAB data type that cannot be represented in small notation. The response from the MATLAB Production Server uses large notation by default.
A JSON object in the large notation contains the following property
name-value pairs.
| Property Name | Property Value |
|---|---|
"mwdata" | JSON array representing the actual data. Specify
the property value by enclosing the data as a comma-separated list
within []. |
"mwsize" | JSON array representing the dimensions of the
data. Specify the property value by enclosing the dimensions as a
comma-separated list within []. |
"mwtype" | JSON "double" | "single" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" | "int64" | "uint64" | "logical" | "char" | "struct" | "cell" | "string" | "datetime"| "<class name of enumeration>" |
"mwcomplex" | For complex numbers, set the property value to JSON
true. |
MATLAB Compiler SDK™ provides the following utility functions for data conversion between MATLAB and JSON.
| Function Name | Purpose |
|---|---|
mps.json.encoderequest (MATLAB Compiler SDK) | Convert MATLAB data in a server request to JSON text using MATLAB Production Server JSON schema. |
mps.json.decoderesponse (MATLAB Compiler SDK) | Convert JSON text from a server response to MATLAB data. |
mps.json.encode (MATLAB Compiler SDK) | Convert MATLAB data to JSON text using MATLAB Production Server JSON schema. |
mps.json.decode (MATLAB Compiler SDK) | Convert a character vector or string in MATLAB Production Server JSON schema to MATLAB data. |
The RESTful API supports the following MATLAB data types.
Numeric Types: double, single and Integers
The
mwdataproperty must be a JSON array of JSON numbers.The
mwtypeproperty can be any ofdouble,single,int8,uint8,int16,uint16,int32,uint32,int64,uint64.You cannot represent scalar or multidimensional
singleand integer types using JSON small notation.Starting in R2020a,
int64anduint64numbers maintain precision and range in their JSON representation as they are not converted todouble.
Scalar Numeric Types: double, single and Integers
The
mwdataproperty must be a JSON array containing one JSON number representing the MATLAB scalar value.The
mwsizeproperty must be a JSON array containing 1,1.
JSON Representation of Scalar Numeric Types: double,
single and Integers
| MATLAB Data Type | JSON Small Notation | JSON Large Notation |
|---|---|---|
| No small representation |
{
"mwdata": [JSON number],
"mwsize": [1,1],
"mwtype": "single" | "int8" | "uint8" | "int16" | "uint16" |
"int32" | "uint32" | "int64" | "uint64"
}
|
double | JSON number |
{
"mwdata": [JSON number],
"mwsize": [1,1],
"mwtype": "double"
}
|
MATLAB Data: Scalar Numerics | JSON Small Notation | JSON Large Notation |
|---|---|---|
int8(23) | No small representation |
{
"mwdata": [23],
"mwsize": [1,1],
"mwtype": "int8"
}
|
uint8(27) | No small representation |
{
"mwdata": [27],
"mwsize": [1,1],
"mwtype": "uint8"
}
|
single(20.15) | No small representation |
{
"mwdata": [20.15],
"mwsize": [1,1],
"mwtype": "single"
}
|
intmax('int64') | No small representation |
{
"mwdata": [9223372036854775807],
"mwsize": [1,1],
"mwtype": "int64"
}
|
double(12.905) | 12.905 |
{
"mwdata": [12.905],
"mwsize": [1,1],
"mwtype": "double"
}
|
42 | 42 |
{
"mwdata": [42],
"mwsize": [1,1],
"mwtype": "double"
}
|
Multidimensional Numeric Types: double, single and Integers
The
mwdataproperty must be a JSON array containing data from multidimensional arrays in column-major order. This ordering corresponds to the default memory layout in MATLAB.You must represent
doublearrays, except N-by-1doublearrays, with nested JSON arrays when using small notationYou cannot represent multidimensional
singleand integer types using JSON small notation.
MATLAB Data: Multidimensional
| JSON Small Notation | JSON Large Notation |
|---|---|---|
[1,2,3;... 4,5,6] |
[[1,2,3],[4,5,6]] |
{
"mwdata":[1,4,2,5,3,6],
"mwsize":[2,3],
"mwtype":"double"
} |
[1, NaN, -Inf;... 2, 105, Inf] |
[[1,{"mwdata": "NaN"},{"mwdata": "-Inf"}],[2,105,{"mwdata": "Inf"}]] |
{
"mwdata":[1, 2, "NaN", 105, "-Inf", "Inf"],
"mwsize":[2,3],
"mwtype":"double"
} |
[ 1 2; 4 5; 7 8 ] |
[[1, 2], [4, 5], [7, 8]] |
{
"mwdata":[1,4,7,2,5,8],
"mwsize":[3,2],
"mwtype":"double"
} |
a(:,:,1) =
1 2
3 4
5 6
a(:,:,2) =
7 8
9 10
11 12 |
[[[1,7],[2,8]],[[3,9],[4,10]],[[5,11],[6,12]]] |
{
"mwdata":[1,3,5,2,4,6,7,9,11,8,10,12],
"mwsize":[3,2,2],
"mwtype":"double"
} |
[17;500] |
[17,500] |
{
"mwdata":[17,500],
"mwsize":[2,1],
"mwtype":"double"
} |
[17,500] |
[[17,500]] |
{
"mwdata":[17,500],
"mwsize":[1,2],
"mwtype":"double"
} |
Numeric Types: NaN, Inf, and -Inf
NaN,Inf, and-Infare numeric types whose underlying MATLAB class can be eitherdoubleorsingleonly. You cannot representNaN,Inf, and-Infas an integer type in MATLAB.
MATLAB Data: NaN, Inf,
and -Inf | JSON Small Notation | JSON Large Notation |
|---|---|---|
NaN |
{"mwdata":"NaN"} | {
"mwdata": ["NaN"],
"mwsize": [1,1],
"mwtype": "double"
}
or {
"mwdata": [{"mwdata":"NaN"}],
"mwsize": [1,1],
"mwtype": "double"
}
|
Inf |
{"mwdata":"Inf"} | {
"mwdata": ["Inf"],
"mwsize": [1,1],
"mwtype": "double"
}
or {
"mwdata": [{"mwdata":"Inf"}],
"mwsize": [1,1],
"mwtype": "double"
}
|
-Inf |
{"mwdata":"-Inf"} | {
"mwdata": ["-Inf"],
"mwsize": [1,1],
"mwtype": "double"
}
or {
"mwdata": [{"mwdata":"-Inf"}],
"mwsize": [1,1],
"mwtype": "double"
}
|
Numeric Types: Complex Numbers
The
mwdataproperty values must contain the real and imaginary parts of the complex number represented side by side.You must set an additional property
mwcomplexwith the value oftrue.The
mwtypeproperty can be any ofdouble,single,int8,uint8,int16,uint16,int32,uint32,int64,uint64.You cannot represent complex numbers using small notation.
JSON Representation of Complex Numbers
| MATLAB Data | JSON Large Notation |
|---|---|
a + bi |
{
"mwcomplex": true,
"mwdata": [a,b],
"mwsize": [1,1],
"mwtype": "double"
}
|
| MATLAB Data: Scalar Complex Number | JSON Large Notation |
|---|---|
int32(3 + 4i) |
{
"mwcomplex": true,
"mwdata": [3,4],
"mwsize": [1,1],
"mwtype": "int32"
}
|
| MATLAB Data: Multidimensional Array of Complex Numbers | JSON Large Notation |
|---|---|
[1 - 2i;... 3 + 7i] |
{
"mwcomplex": true,
"mwdata":[1, -2, 3, 7],
"mwsize":[2,1],
"mwtype":"double",
}
|
Character Array
The
mwdataproperty must be an array of JSONstrings.The
mwtypeproperty must have the value ofchar.You can represent scalar characters and 1-by-N character arrays in small notation.
You cannot represent multidimensional character arrays in large notation.
JSON Representation of char
| MATLAB Data Type | JSON Small Notation (for scalar and single dimensional character arrays) | JSON Large Notation |
|---|---|---|
char | JSON string |
{
"mwdata": [JSON string],
"mwsize": [<char dimensions>],
"mwtype": "char"
}
|
| MATLAB Data: Scalar and Single-dimensional Character Array | JSON Small Notation | JSON Large Notation |
|---|---|---|
'a' | "a" |
{
"mwdata": ["a"],
"mwsize": [1,1],
"mwtype": "char"
}
|
'hey, jude' | "hey, jude" |
{
"mwdata": ["hey, jude"],
"mwsize": [1,9],
"mwtype": "char"
}
|
| MATLAB Data: Multidimensional Character Array | JSON Large Notation |
|---|---|
['boston';... '123456'] |
{
"mwdata": ["b1o2s3t4o5n6"],
"mwsize": [2,6],
"mwtype": "char"
}
|
Logical
The
mwdataproperty must contain only JSONtrueorfalseboolean values. For multidimensionallogicaldata, represent the values in column-major order.The
mwtypeproperty must have the value oflogical.In the small notation, you must represent multidimensional
logicalarrays with nested JSON arrays.
JSON Representation of logical
| MATLAB Data Type | JSON Small Notation | JSON Large Notation |
|---|---|---|
logical | true | false |
{
"mwtype": "logical",
"mwsize": [1,1],
"mwdata": [true | false]
}
|
MATLAB Data: Scalar logical | JSON Small Notation | JSON Large Notation |
|---|---|---|
logical(1) or
true | true |
{
"mwdata": [true],
"mwsize": [1,1],
"mwtype": "logical"
}
|
logical(0) or
false | false |
{
"mwdata": [false],
"mwsize": [1,1],
"mwtype": "logical"
}
|
MATLAB Data: Multidimensional logical
Array | JSON Small Notation | JSON Large Notation |
|---|---|---|
[true,false;... true,false;... true,false] |
[[[true,false],[true,false],[true,false]]] |
{
"mwdata": [true,true,true,false,false,false],
"mwsize": [3,2],
"mwtype": "logical"
}
|
Cell Array
The
mwdataproperty must be a JSONarraythat contains the values of the cells in their JSON representation.The
mwtypeproperty must have the value ofcell.You cannot represent
cellarrays using small notation.MATLAB Data Type JSON Large Notation cell{ "mwdata": [<cell data>], "mwsize": [<cell dimensions>], "mwtype": "cell" }Although you must represent cell arrays using large notation only, if the data type of a
cellelement supports small notation, you can represent that element in small notation when encoding thecellarray in JSON.The following table shows an example.
MATLAB Data: cellArrayJSON Large Notation with some cellelements in Small NotationJSON Large Notation with all cellelements in Large Notation{'Primes',[10 23 199],{false,true,'maybe'}}{ "mwdata": ["Primes", [[10, 23, 199]], { "mwdata": [false, true, "maybe"], "mwsize": [1, 3], "mwtype": "cell" } ], "mwsize": [1, 3], "mwtype": "cell" }{ "mwdata": [{ "mwdata": ["Primes"], "mwsize": [1, 6], "mwtype": "char" },{ "mwdata": [10, 23, 199], "mwsize": [1, 3], "mwtype": "double" },{ "mwdata": [{ "mwdata": [false], "mwsize": [1, 1], "mwtype": "logical" },{ "mwdata": [true], "mwsize": [1, 1], "mwtype": "logical" },{ "mwdata": ["maybe"], "mwsize": [1, 5], "mwtype": "char" }], "mwsize": [1, 3], "mwtype": "cell" }], "mwsize": [1, 3], "mwtype": "cell" }For more information on MATLAB
celldata type, seecell(MATLAB).
Structure Array
The
mwdataproperty must be a JSON object that contains name-value pairs, where the name matches a field in thestructand value is a JSON array that represents the data in the field.The
mwtypeproperty must have the value ofstruct.Although you must represent multidimensional
structarrays using JSON large notation, if the data type of astructvalue supports small notation, you can represent that value in small notation when encoding thestructin JSON.You can represent only a scalar
structin small notation.JSON Representation of
structarraysMATLAB Data Type JSON Small Notation (valid only for a scalar struct)JSON Large Notation structJSON object { "mwdata": {<struct data>} "mwsize": [<struct dimensions>], "mwtype": "struct" }MATLAB Data: Scalar Structure Array JSON Small Notation JSON Large Notation struct('name','John Smith','age',15){ "name" : "John Smith", "age" : 15 }{ "mwdata": { "age": [{ "mwdata": [15], "mwsize": [1, 1], "mwtype": "double" }], "name": [{ "mwdata": ["John Smith"], "mwsize": [1, 10], "mwtype": "char" }] }, "mwsize": [1, 1], "mwtype": "struct" }Although you can represent 1-by-1
structarrays in small notation, if the data type of astructvalue does not support small notation, you must represent that value in large notation when encoding thestructin JSON.MATLAB Data: 1-by-1 Structure Array JSON Small Notation with some structvalues in Large NotationJSON Large Notation with all structvalues in Large Notationstruct('Name',{{'Casper','Ghost'}},... 'Age',{[14,17,18]},... 'Date', {736676}){ "Age": [[14, 17, 18]], "Date": 736676, "Name": { "mwdata": ["Casper", "Ghost"], "mwsize": [1, 2], "mwtype": "cell" } }{ "mwdata": { "Age": [{ "mwdata": [14, 17, 18], "mwsize": [1, 3], "mwtype": "double" }], "Date": [{ "mwdata": [736676], "mwsize": [1, 1], "mwtype": "double" }], "Name": [{ "mwdata": [{ "mwdata": ["Casper"], "mwsize": [1, 6], "mwtype": "char" }, { "mwdata": ["Ghost"], "mwsize": [1, 5], "mwtype": "char" }], "mwsize": [1, 2], "mwtype": "cell" }] }, "mwsize": [1, 1], "mwtype": "struct" }Although you must represent multidimensional
structarrays using JSON large notation, if the data type of astructvalue supports small notation, you can represent that value in small notation when encoding thestructin JSON.MATLAB Data: Multidimensional Structure Array JSON Large Notation with some structvalues in Small NotationJSON Large Notation with all structvalues in Large Notationstruct( 'Name',{'Casper','Ghost';... 'Genie' ,'Wolf'},... 'Ages',{14,17;... 20,23} ){ "mwdata":{ "Ages":[14,20,17,23], "Name":["Casper","Genie","Ghost","Wolf"] }, "mwsize":[2,2], "mwtype":"struct" }{ "mwdata":{ "Ages":[{ "mwdata":[14], "mwsize":[1,1], "mwtype":"double" },{ "mwdata":[20], "mwsize":[1,1], "mwtype":"double" },{ "mwdata":[17], "mwsize":[1,1], "mwtype":"double" },{ "mwdata":[23], "mwsize":[1,1], "mwtype":"double" }], "Name":[{ "mwdata":["Casper"], "mwsize":[1,6], "mwtype":"char" },{ "mwdata":["Genie"], "mwsize":[1,5], "mwtype":"char" },{ "mwdata":["Ghost"], "mwsize":[1,5], "mwtype":"char" },{ "mwdata":["Wolf"], "mwsize":[1,4], "mwtype":"char" }] }, "mwsize":[2,2], "mwtype":"struct" }For more information on MATLAB
structdata type, seestruct(MATLAB).
String Array
The
mwdataproperty must be a JSON array containing strings in column-major order.The
mwtypeproperty must have the value ofstring.You cannot represent
stringarrays using small JSON notation.JSON Representation of
stringarraysMATLAB Data Type JSON Large Notation string{ "mwdata": [JSON string], "mwsize": [<string dimensions>], "mwtype": "string" }MATLAB Data: Scalar, Single-dimensional, Multidimensional, and
missing(MATLAB)stringArraysJSON Large Notation "abc"{ "mwdata": ["abc"], "mwsize": [1, 1], "mwtype": "string" }["abc"]{ "mwdata": ["abc"], "mwsize": [1, 1], "mwtype": "string" }["abc" "de"]{ "mwdata": ["abc", "de"], "mwsize": [1, 2], "mwtype": "string" }["abc" "de"; "fg" "hi"]{ "mwdata": ["abc", "fg", "de", "hi"], "mwsize": [2, 2], "mwtype": "string" }string(missing){ "mwdata": [{"mwdata": "missing"}], "mwsize": [1, 1], "mwtype": "string" }For more information on MATLAB
stringdata type, seestring, " "(MATLAB).
Enumeration
The
mwdataproperty must be a JSON array of strings denoting the enumeration members.The
mwtypeproperty must be set to the class of the enumerations in the array.You cannot represent an
enumerationusing small JSON notation.JSON Representation of
enumerationMATLAB Data Type JSON Large Notation enumeration{ "mwdata": [JSON string], "mwsize": [<enumeration dimensions>], "mwtype": "<class name of enumeration>" }The following table shows examples of JSON representation of an
enumeration.Use the following enumeration for the examples. For more information, see Define Enumeration Classes (MATLAB).
classdef Colors enumeration Black Blue Red end endMATLAB Data: Object of Enumeration Class JSON Large Notation b = Colors.Black{ "mwdata": ["Black"], "mwsize": [1, 1], "mwtype": "Colors" }b = [Colors.Black Colors.Blue]{ "mwdata": ["Black", "Blue"], "mwsize": [1, 2], "mwtype": "Colors" }For more information on MATLAB
enumerationdata type, seeenumeration(MATLAB).
Datetime Array
The
mwdataproperty must be a JSON object containing name-value pairs forTimeStampand optionally forLowOrderTimeStamp. Values forTimeStampandLowOrderTimeStampare JSON representation of thedoubledata type.The
TimeStampproperty values represent the POSIX time in milliseconds elapsed since 00:00:00 1-Jan-1970 UTC (Coordinated Universal Time).The
LowOrderTimeStampproperty values represent additional resolution in the timestamp. Use this property to maintain precision past milliseconds.Although you must represent
datetimearrays using large notation only, sinceTimeStampandLowOrderTimeStamprepresent values of thedoubledata type which supports small notation, you can representTimeStampandLowOrderTimeStampusing small notation when encodingdatetimearrays in JSON.
The
mwmetadataproperty must be a JSON object containing name-value pairs forTimeZoneandFormat. Values forTimeZoneandFormatare JSON representation of thechardata type.The values of the
TimeZoneandFormatproperties contain metadata necessary for recreating thedatetimevalues with timezones in MATLAB in their original display format. This metadata is necessary because the numeric values contained in theTimeStampandLowOrderTimeStamparrays are calculated with respect to UTC.You can specify
TimeZoneandFormatproperties forNaTandInfdatetimearray values.Although you must represent
datetimearrays using large notation only, sinceTimeZoneandFormatrepresent values of thechardata type which supports small notation, you can representTimeZoneandFormatusing small notation when encodingdatetimearrays in JSON.The value for
TimeZonecan be empty.The default value for
Formatdepends on your system locale. For more information, see Default datetime Format (MATLAB).
The
mwtypeproperty must have the value ofdatetime.You cannot represent
datetimearrays using small JSON notation.JSON Representation of
datetimearraysMATLAB Data Type JSON Large Notation datetime{ "mwdata": { "LowOrderTimeStamp": <JSON number> "TimeStamp": <JSON number> }, "mwmetadata": { "TimeZone": <JSON string>, "Format": <JSON string> }, "mwsize": [<datetime array dimensions>], "mwtype": "datetime" }MATLAB Data: Scalar datetimeArrayJSON Large Notation with mwdataandmwmetadatain Small NotationJSON Large Notation with mwdataandmwmetadatain Large Notationdatetime(2015, 3, 24);
{ "mwdata": { "TimeStamp": 1.4271552E+12 }, "mwmetadata": { "Format": "dd-MMM-uuuu", "TimeZone": "" }, "mwsize": [1, 1], "mwtype": "datetime" }{ "mwdata": { "TimeStamp": { "mwdata": [1.4271552E+12], "mwsize": [1, 1], "mwtype": "double" } }, "mwmetadata": { "Format": { "mwdata": ["dd-MMM-uuuu"], "mwsize": [1, 11], "mwtype": "char" }, "TimeZone": { "mwdata": [""], "mwsize": [0, 0], "mwtype": "char" } }, "mwsize": [1, 1], "mwtype": "datetime" }The following table shows JSON representation for a
datetimerow vector. SinceLowOrderTimeStampandTimeStampcontaindoublevalues, you need to use nested JSON arrays when representing multidimensional (except N-by-1) arrays ofLowOrderTimeStampandTimeStampin small notation.MATLAB Data: datetimeRow VectorJSON Large Notation with mwdataandmwmetadatain Small NotationJSON Large Notation with mwdataandmwmetadatain Large Notationdatetime(2018,1,8,10,... 11,12,(1:5)+(1:5)*1e-6,... 'TimeZone','local');
{ "mwdata": { "LowOrderTimeStamp": [[9.9999999991773336E-7, 1.9999999998354667E-6, 2.9999999999752447E-6, 3.9999999996709334E-6, 4.9999999998107114E-6]], "TimeStamp": [[1.515424272001E+12, 1.515424272002E+12, 1.515424272003E+12, 1.515424272004E+12, 1.515424272005E+12]], }, "mwmetadata": { "Format":"dd-MMM-uuuu HH:mm:ss", "TimeZone": "America\/New_York", }, "mwsize": [1, 5], "mwtype": "datetime" }{ "mwdata": { "LowOrderTimeStamp": { "mwdata": [9.9999999991773336E-7, 1.9999999998354667E-6, 2.9999999999752447E-6, 3.9999999996709334E-6, 4.9999999998107114E-6], "mwsize": [1, 5], "mwtype": "double" }, "TimeStamp": { "mwdata": [1.515424272001E+12, 1.515424272002E+12, 1.515424272003E+12, 1.515424272004E+12, 1.515424272005E+12], "mwsize": [1, 5], "mwtype": "double" } }, "mwmetadata": { "Format": { "mwdata": ["dd-MMM-uuuu HH:mm:ss"], "mwsize": [1, 20], "mwtype": "char" }, "TimeZone": { "mwdata": ["America\/New_York"], "mwsize": [1, 16], "mwtype": "char" } }, "mwsize": [1, 5], "mwtype": "datetime" }MATLAB Data: datetimeColumn VectorJSON Large Notation with mwdataandmwmetadatain Small NotationJSON Large Notation with mwdataandmwmetadatain Large Notationdatetime(2018,1,8,10,... 11,12,(1:5)+(1:5)*1e-6,... 'TimeZone','local')';
{ "mwdata": { "LowOrderTimeStamp": [9.9999999991773336E-7, 1.9999999998354667E-6, 2.9999999999752447E-6, 3.9999999996709334E-6, 4.9999999998107114E-6], "TimeStamp": [1.515424272001E+12, 1.515424272002E+12, 1.515424272003E+12, 1.515424272004E+12, 1.515424272005E+12], }, "mwmetadata": { "Format":"dd-MMM-uuuu HH:mm:ss", "TimeZone": "America\/New_York", }, "mwsize": [5, 1], "mwtype": "datetime" }{ "mwdata": { "LowOrderTimeStamp": { "mwdata": [9.9999999991773336E-7, 1.9999999998354667E-6, 2.9999999999752447E-6, 3.9999999996709334E-6, 4.9999999998107114E-6], "mwsize": [5, 1], "mwtype": "double" }, "TimeStamp": { "mwdata": [1.515424272001E+12, 1.515424272002E+12, 1.515424272003E+12, 1.515424272004E+12, 1.515424272005E+12], "mwsize": [5, 1], "mwtype": "double" } }, "mwmetadata": { "Format": { "mwdata": ["dd-MMM-uuuu HH:mm:ss"], "mwsize": [1, 20], "mwtype": "char" }, "TimeZone": { "mwdata": ["America\/New_York"], "mwsize": [1, 16], "mwtype": "char" } }, "mwsize": [5, 1], "mwtype": "datetime" }MATLAB Data:
NaTandInfdatetimeArrayJSON Large Notation with mwdataandmwmetadatain Small NotationJSON Large Notation with mwdataandmwmetadatain Large NotationNaT
{ "mwdata": { "TimeStamp": { "mwdata": "NaN" } }, "mwmetadata": { "Format": "dd-MMM-uuuu HH:mm:ss", "TimeZone": "" }, "mwsize": [1, 1], "mwtype": "datetime" }{ "mwdata": { "TimeStamp": { "mwdata": ["NaN"], "mwsize": [1, 1], "mwtype": "double" } }, "mwmetadata": { "Format": { "mwdata": ["dd-MMM-uuuu HH:mm:ss"], "mwsize": [1, 20], "mwtype": "char" }, "TimeZone": { "mwdata": [""], "mwsize": [0, 0], "mwtype": "char" } }, "mwsize": [1, 1], "mwtype": "datetime" }datetime(inf,inf,inf)
{ "mwdata": { "TimeStamp": { "mwdata": "Inf" } }, "mwmetadata": { "Format": "dd-MMM-uuuu HH:mm:ss", "TimeZone": "" }, "mwsize": [1, 1], "mwtype": "datetime" }{ "mwdata": { "TimeStamp": { "mwdata": ["Inf"], "mwsize": [1, 1], "mwtype": "double" } }, "mwmetadata": { "Format": { "mwdata": ["dd-MMM-uuuu HH:mm:ss"], "mwsize": [1, 20], "mwtype": "char" }, "TimeZone": { "mwdata": [""], "mwsize": [0, 0], "mwtype": "char" } }, "mwsize": [1, 1], "mwtype": "datetime" }For more information on MATLAB
datetimedata type, seedatetime(MATLAB).
Empty Array: []
Empty arrays
[]cannot be of typestruct.
| MATLAB Data: Empty Array | JSON Small Notation | JSON Large Notation |
|---|---|---|
[] |
[] |
{
"mwdata": [],
"mwsize": [0,0],
"mwtype": "double" | "single"
"int8" | "uint8" | "int16" | "uint16"
"int32" | "uint32" | "int64" | "uint64"
"logical" | "char" | "cell" | "string"
"<class name of enumeration>"
}
|