__dictionary2json__
datatypes: errmsg = __dictionary2json__ (tree, file, pretty, preserve)
Write a tree of JSON values to a file.
tree has the form __json2dictionary__ returns: an object is a scalar structure with the fields keys and values, the keys text, numbers or logical values; an array a cell array; text a character row; a number or logical value a scalar, a vector of them an array; and null a 0-by-0 structure array with no fields. pretty indents by four spaces, preserve writes NaN and Inf rather than null. errmsg is empty, or names the file that could not be written.
This is a helper IO function for the writedictionary method. Do NOT call it directly.
Source Code: __dictionary2json__