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
double
andlogical
data types, scalar and 1-by-Nchar
data type and scalarstruct
.Large notation provides a generic representation of MATLAB data types in JSON. The large format uses the JSON
object
notation 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
mwdata
property must be a JSON array of JSON numbers.The
mwtype
property can be any ofdouble
,single
,int8
,uint8
,int16
,uint16
,int32
,uint32
,int64
,uint64
.You cannot represent scalar or multidimensional
single
and integer types using JSON small notation.Starting in R2020a,
int64
anduint64
numbers maintain precision and range in their JSON representation as they are not converted todouble
.
Scalar Numeric Types: double
, single
and Integers
The
mwdata
property must be a JSON array containing one JSON number representing the MATLAB scalar value.The
mwsize
property 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
mwdata
property 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
double
arrays, except N-by-1double
arrays, with nested JSON arrays when using small notationYou cannot represent multidimensional
single
and 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-Inf
are numeric types whose underlying MATLAB class can be eitherdouble
orsingle
only. You cannot representNaN
,Inf
, and-Inf
as 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
mwdata
property values must contain the real and imaginary parts of the complex number represented side by side.You must set an additional property
mwcomplex
with the value oftrue
.The
mwtype
property 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
mwdata
property must be an array of JSONstrings
.The
mwtype
property 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
mwdata
property must contain only JSONtrue
orfalse
boolean values. For multidimensionallogical
data, represent the values in column-major order.The
mwtype
property must have the value oflogical
.In the small notation, you must represent multidimensional
logical
arrays 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
mwdata
property must be a JSONarray
that contains the values of the cells in their JSON representation.The
mwtype
property must have the value ofcell
.You cannot represent
cell
arrays 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
cell
element supports small notation, you can represent that element in small notation when encoding thecell
array in JSON.The following table shows an example.
MATLAB Data: cell
ArrayJSON Large Notation with some cell
elements in Small NotationJSON Large Notation with all cell
elements 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
cell
data type, see cell (MATLAB).
Structure Array
The
mwdata
property must be a JSON object that contains name-value pairs, where the name matches a field in thestruct
and value is a JSON array that represents the data in the field.The
mwtype
property must have the value ofstruct
.Although you must represent multidimensional
struct
arrays using JSON large notation, if the data type of astruct
value supports small notation, you can represent that value in small notation when encoding thestruct
in JSON.You can represent only a scalar
struct
in small notation.JSON Representation of
struct
arraysMATLAB Data Type JSON Small Notation (valid only for a scalar struct
)JSON Large Notation struct
JSON 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
struct
arrays in small notation, if the data type of astruct
value does not support small notation, you must represent that value in large notation when encoding thestruct
in JSON.MATLAB Data: 1-by-1 Structure Array JSON Small Notation with some struct
values in Large NotationJSON Large Notation with all struct
values 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
struct
arrays using JSON large notation, if the data type of astruct
value supports small notation, you can represent that value in small notation when encoding thestruct
in JSON.MATLAB Data: Multidimensional Structure Array JSON Large Notation with some struct
values in Small NotationJSON Large Notation with all struct
values 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
struct
data type, see struct (MATLAB).
String Array
The
mwdata
property must be a JSON array containing strings in column-major order.The
mwtype
property must have the value ofstring
.You cannot represent
string
arrays using small JSON notation.JSON Representation of
string
arraysMATLAB Data Type JSON Large Notation string
{ "mwdata": [JSON string], "mwsize": [<string dimensions>], "mwtype": "string"}
MATLAB Data: Scalar, Single-dimensional, Multidimensional, and missing (MATLAB)
string
ArraysJSON 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
string
data type, see string (MATLAB).
Enumeration
The
mwdata
property must be a JSON array of strings denoting the enumeration members.The
mwtype
property must be set to the class of the enumerations in the array.You cannot represent an
enumeration
using small JSON notation.JSON Representation of
enumeration
MATLAB 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 endend
MATLAB 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
enumeration
data type, see enumeration (MATLAB).
Datetime Array
The
mwdata
property must be a JSON object containing name-value pairs forTimeStamp
and optionally forLowOrderTimeStamp
. Values forTimeStamp
andLowOrderTimeStamp
are JSON representation of thedouble
data type.The
TimeStamp
property values represent the POSIX time in milliseconds elapsed since 00:00:00 1-Jan-1970 UTC (Coordinated Universal Time).The
LowOrderTimeStamp
property values represent additional resolution in the timestamp. Use this property to maintain precision past milliseconds.Although you must represent
datetime
arrays using large notation only, sinceTimeStamp
andLowOrderTimeStamp
represent values of thedouble
data type which supports small notation, you can representTimeStamp
andLowOrderTimeStamp
using small notation when encodingdatetime
arrays in JSON.
The
mwmetadata
property must be a JSON object containing name-value pairs forTimeZone
andFormat
. Values forTimeZone
andFormat
are JSON representation of thechar
data type.The values of the
TimeZone
andFormat
properties contain metadata necessary for recreating thedatetime
values with timezones in MATLAB in their original display format. This metadata is necessary because the numeric values contained in theTimeStamp
andLowOrderTimeStamp
arrays are calculated with respect to UTC.You can specify
TimeZone
andFormat
properties forNaT
andInf
datetime
array values.Although you must represent
datetime
arrays using large notation only, sinceTimeZone
andFormat
represent values of thechar
data type which supports small notation, you can representTimeZone
andFormat
using small notation when encodingdatetime
arrays in JSON.The value for
TimeZone
can be empty.The default value for
Format
depends on your system locale. For more information, see Default datetime Format (MATLAB).
The
mwtype
property must have the value ofdatetime
.You cannot represent
datetime
arrays using small JSON notation.JSON Representation of
datetime
arraysMATLAB 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 datetime
ArrayJSON Large Notation with mwdata
andmwmetadata
in Small NotationJSON Large Notation with mwdata
andmwmetadata
in 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
datetime
row vector. SinceLowOrderTimeStamp
andTimeStamp
containdouble
values, you need to use nested JSON arrays when representing multidimensional (except N-by-1) arrays ofLowOrderTimeStamp
andTimeStamp
in small notation.MATLAB Data: datetime
Row VectorJSON Large Notation with mwdata
andmwmetadata
in Small NotationJSON Large Notation with mwdata
andmwmetadata
in 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: datetime
Column VectorJSON Large Notation with mwdata
andmwmetadata
in Small NotationJSON Large Notation with mwdata
andmwmetadata
in 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:
NaT
andInf
datetime
ArrayJSON Large Notation with mwdata
andmwmetadata
in Small NotationJSON Large Notation with mwdata
andmwmetadata
in 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
datetime
data type, see datetime (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>" } |
Related Topics
- RESTful API for MATLAB Function Execution
- Fundamental MATLAB Classes (MATLAB)
External Websites
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Contact your local office