Closed
Description
When I try to save the array with option ArrayToStruct, the size attribute doesn't get recovered. Here is a example where I creating ubjson out of matlab structure and dumping it to file.
>> d.a = randn(3,3);
>> d.b = 'hello';
>> opt.ArrayToStruct = 1;
>> opt.Compact = 1;
>> s = saveubjson('',d,opt);
>> fid = fopen('/tmp/ubjson.json','wb');
>> fwrite(fid,s);
>> fclose(fid);
Here in python I am opening the file and trying to reconstruct the structure of matlab, everything works well except the ArraySize attribute. shouldn't it be list like ArrayData?
In [92]: f = open('/tmp/ubjson.json','rb')
In [93]: data = f.read()
In [94]: f.close()
In [95]: d = ubjson.loadb(data)
In [96]: d
Out[96]:
{u'a': {u'_ArrayData_': [5.235096335266677e+97,
4.82949938982368e+217,
-1.6371385346751378e+252,
-2.173139193905037e-245,
-1.050486479578402e+294,
3.1118306554669778e+237,
5.3658739553167216e+110,
-6.843893294653657e-14,
-1.1042601089134405e+282],
u'_ArraySize_': '\x03\x03',
u'_ArrayType_': u'double'},
u'b': u'hello'}