Welcome! Log In Create A New Profile

Advanced

Problem with MLREAD/MATLAB 2020a?

Posted by acecala 
Problem with MLREAD/MATLAB 2020a?
July 24, 2020 03:52PM
Hi Jaewon,

I recently upgraded from using MATLAB 2018b to MATLAB 2020a. When I try to open .h5 files (both ones I've opened before and new ones I just created) I receive the following errors:

Brace indexing is not supported for variables of this type.

Error in mlhdf5/read_variable (line 224)
case 'char', val = val{1};

Error in mlhdf5/read_variable (line 215)
for m=1:length(names), val{m} = read_variable(obj,[location '/' names{m}]); end

Error in mlhdf5/read_variable (line 205)
for m=1:length(names), val.(names{m}) = read_variable(obj,[location '/' names{m}]); end

Error in mlhdf5/read_variable (line 207)
for m=1:count, val(m) = read_variable(obj,[location '/' num2str(m)]); end %#ok<AGROW>

Error in mlhdf5/read_variable (line 205)
for m=1:length(names), val.(names{m}) = read_variable(obj,[location '/' names{m}]); end

Error in mlhdf5/read_variable (line 205)
for m=1:length(names), val.(names{m}) = read_variable(obj,[location '/' names{m}]); end

Error in mlhdf5/read_trial (line 134)
val(idx) = read_variable(obj,[obj.root names{m}]); %#ok<AGROW>

Error in mlread (line 28)
data = fid.read_trial();

This error occurs with older (need to look up the build number) and latest version of mlread.m and mlhd5.m found in build 217. Aside from the MATLAB version, I am not sure what else could be different on my end. May I employ your help troubleshooting?

Thanks for your time.
Re: Problem with MLREAD/MATLAB 2020a?
July 26, 2020 10:52AM
Update your mlhdf5.m with the attached file or download the package again.

By the way, HDF5 is not a good format for saving data. It is extremely slow. Read the following post, if you are interested.
https://cyrille.rossant.net/moving-away-hdf5/
Attachments:
open | download - mlhdf5.m (12.1 KB)
Re: Problem with MLREAD/MATLAB 2020a?
July 28, 2020 11:33AM
Thanks Jaewon!

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.