Rank: 4723 based on 7 downloads (last 30 days) and 1 file submitted
photo

Jonas Almeida

E-mail
Company/University
Univ Texas MDAnderson Cancer Ctr

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Jonas
Updated   File Tags Downloads
(last 30 days)
Comments Rating
05 Apr 2010 Published MATLAB Files json4mat This Matlab toolbox converts JSON formats into (json2mat) and from (mat2json) Matlab structures. Author: Jonas Almeida json 7 4
  • 4.75
4.8 | 4 ratings
Comments and Ratings on Jonas' Files View all
Updated File Comment by Comments Rating
19 Nov 2012 json4mat This Matlab toolbox converts JSON formats into (json2mat) and from (mat2json) Matlab structures. Author: Jonas Almeida Riba, Jordi

Sorry, did not wake up today ...
kk=json2mat ('xx.js',1)

19 Nov 2012 json4mat This Matlab toolbox converts JSON formats into (json2mat) and from (mat2json) Matlab structures. Author: Jonas Almeida Riba, Jordi

Hi, this file works really good to extract data from json files!!!

However I try to assign the results to a variable (to avoid having it in ans= ...) and I cannot do it. Any ideas? Thanks.

17 Mar 2012 json4mat This Matlab toolbox converts JSON formats into (json2mat) and from (mat2json) Matlab structures. Author: Jonas Almeida ted teng

05 Mar 2012 json4mat This Matlab toolbox converts JSON formats into (json2mat) and from (mat2json) Matlab structures. Author: Jonas Almeida Herrera, Jorge

Great tool! I just found a small bug. The code fails to write a correct JSON object when there's an empty array (and probably also fails with an empty cell).

Line 29 in mat2json.m it reads:

J(end)=']';

When the array is empty, this line will replace the opening '[' with the closing ']' (there's no trailing comma to replace!). A simple length check or string comparison to handle this edge case should fix it.

Thanks,
Jorge

29 Apr 2010 json4mat This Matlab toolbox converts JSON formats into (json2mat) and from (mat2json) Matlab structures. Author: Jonas Almeida Korneliussen, Jan Tore

Thanks for a very useful toolbox. I found a certain nesting of MATLAB structures and cell arrays which can not be taken for a round-trip to JSON and back. This snippet fails in the json2mat call:

mystruct0_f1.fieldA = 'A';
mystruct0_f1.fieldB = 'B';
mystruct0.field0 = 1;
mystruct0.field1 = mystruct0_f1;

mystruct1_f3.fieldC = 'C';
mystruct1_f3.fieldD = 'D';
mystruct1.field2 = 2;
mystruct1.field3 = mystruct1_f3;

mycarr = {mystruct0, mystruct1};

json2mat(mat2json(mycarr))

The output:

??? Reference to non-existent element of a cell array.

Error in ==> json2mat at 23
M=extract_struct(JJ{1}{1});

Error in ==> json2mat>extract_struct at 60
y.(t{1}{1})=json2mat(t{1}{2});

Error in ==> json2mat at 23
M=extract_struct(JJ{1}{1});

Error in ==> json2mat>extract_cell at 70
tag{i}=json2mat(x(indOC(i,1):indOC(i,2)));

Error in ==> json2mat at 26
M=extract_cell(JJ{1}{1});

Error in ==> jsontest at 13
json2mat(mat2json(mycarr))

Top Tags Applied by Jonas
json
Files Tagged by Jonas
Updated   File Tags Downloads
(last 30 days)
Comments Rating
05 Apr 2010 Published MATLAB Files json4mat This Matlab toolbox converts JSON formats into (json2mat) and from (mat2json) Matlab structures. Author: Jonas Almeida json 7 4
  • 4.75
4.8 | 4 ratings

Contact us