Writes a struct to a JSON list string. The string can be read by the jsonreads command.
Syntax |
Description |
---|---|
out = jsonwrites(struct); |
Writes the struct to a JSON list string. The string can be read by the jsonreads command. |
out = jsonwrites(); |
Writes the Script Workspace variables to a JSON list string. The string can be read by the jsonreads command. |
Example
The following code example shows how to save the struct "a" to a JSON list "str1".
a = {"b": {1, 2, 3}};
str1 = jsonwrites(a);
The string "str1" is:
?str1;
{
"a" :
{
"a" : [ 1, 2, 3 ]
}
}
The following code example shows how to read the JSON list "str1" to the variable "b":
b = jsonreads(str1);
See Also
jsonload, jsonsave, jsonloads, jsonsaves, jsonread, jsonwrite, jsonreads, JSON files