-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One column table cannot be unserialised after serialisation #66
Comments
this array: |
this is now fixed.
while other arrays are not clearly defined. The result you saw on encoding cell arrays is a result of this ambiguity. I just made the above commit to make two things clear:
please test and let me know if you see any side effect of this fix. I've ran all unit-testing and example scripts, and they seem to work ok. forgot to say - if there is a strong consensus that string arrays and struct arrays should be processed in a similar way, I will port this change to other relevant encoding functions. |
This code recreates the problem
v=[ 1; 2 ]
tab= array2table(v)
str=savejson('',tab)
jv=loadjson(str)
producing the error 'The VariableNames property must contain one name for each variable in the table.'
the json object created by savejson is (in compact form)
'{"_TableCols_":["v"],"_TableRows_":[],"_TableRecords_":[[1,2]]}'
when changed to:
'{"_TableCols_":["v"],"_TableRows_":[],"_TableRecords_":[[1],[2]]}'
it works properly, so the problem seems to be on the save side.
The text was updated successfully, but these errors were encountered: