Reads the value of a JSON list string to a variable.
Syntax |
Description |
---|---|
a = jsonreads(str); |
"str" is a JSON format string. |
Example
The following code example shows how to load the struct "a" defined by a JSON format string to the variable "d".
d = jsonreads('{"a" : ["b", 2, 3]}');
The output result looks like:
?d; result: Struct with fields:
a
?d.a; result: Cell array with 3 elements
?d.a{2};
result:
2
?d.a{3};
result:
3
See Also
jsonsave , jsonload , jsonsaves , jsonloads, jsonread, jsonwrite, jsonwrites, JSON files