2017b >> json = savejson('',data) name name = 0×0 empty char array item item = struct with fields: Test: {["GML"] ["XML"]} level level = 0 vargin varargin = 1×1 cell array {1×1 struct} name name = 'Test' item item = 1×2 cell array {["GML"]} {["XML"]} level level = 1 vargin varargin = 1×1 cell array {1×1 struct} name name = 0×0 empty char array item item = "GML" level level = 2 vargin varargin = 1×1 cell array {1×1 struct} txt txt = ' { }' name name = 0×0 empty char array item item = "XML" level level = 2 vargin varargin = 1×1 cell array {1×1 struct} txt txt = ' { }' txt txt = ' "Test": [ { }, { } ]' txt txt = '{ "Test": [ { }, { } ] }' json = '{ "Test": [ { }, { } ] } '