MATLAB 2012a: Dataset.xmlwrite() 512 character limit

37 views
Skip to first unread message

marc.soumi...@gmail.com

unread,
Apr 27, 2015, 4:24:32 AM4/27/15
to ism...@googlegroups.com
Hi all,

Thanks for developing this super package - I'm learning all sorts of new tricks with it.

I have been trying it with a few different Matlab versions. In R2012a and earlier there is a bug (that you reported) in +ismrmrd/Dataset.m:

http://se.mathworks.com/matlabcentral/answers/48228-possible-bug-in-h5d-write-truncation-of-vlen-strings

            % Matlab is having trouble writing variable length strings
            % that are longer that 512 characters.  Switched to fixed
            % length.
            H5T.set_size(xml_dtype,'H5T_VARIABLE');
            %H5T.set_size(xml_dtype, length(xmlstring));
            xml_space_id = H5S.create_simple (1, 1, []);
            xml_id = H5D.create(obj.fid, obj.xmlpath, xml_dtype, ....
                                 xml_space_id, 'H5P_DEFAULT');
            H5S.close(xml_space_id);

            % Write the data
            H5D.write(xml_id, xml_dtype, ...
                      'H5S_ALL', 'H5S_ALL', 'H5P_DEFAULT', {xmlstring});

I saw that the fix in the comments (it works for R2012a) so I was wondering why it's not used?

Mark



Reply all
Reply to author
Forward
0 new messages