Skip to content

Error with table data #29

Closed
Closed
@pjkoprowski

Description

@pjkoprowski

@fangq

An indexing error occurs when parsing table data using savejson.m

For instance, if one calls the following:

>> j = savejson('test_data', open('census1994.mat'), 'test.json');

you get the following error:

Error using savejson>matlabobject2json (line 444)
You cannot subscript a table using only one subscript. Table subscripting requires both row and variable subscripts.

Error in savejson>obj2json (line 175)
txt=matlabobject2json(name,item,level,varargin{:});

Error in savejson>struct2json (line 285)
txt{end+1}=obj2json(names{e},item(i,j).(names{e}),...

Error in savejson>obj2json (line 171)
txt=struct2json(name,item,level,varargin{:});

Error in savejson (line 140)
json=obj2json(rootname,obj,rootlevel,opt);

I hacked a solution, but I'm not sure if this leads to more issues with other files. See attached.

Cheers,

Paul
paul_savejson.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions