NeuroJSON / easyh5

EasyH5 Toolbox - An easy-to-use HDF5 data interface (loadh5 and saveh5) for MATLAB
BSD 3-Clause "New" or "Revised" License
12 stars 10 forks source link

Parsing HDF5 files with multi-dimensional string cell arrays fails #15

Open jdonley opened 1 month ago

jdonley commented 1 month ago

First of all, thank you for maintaining this library, it is nice work.

I have noticed a bug introduced here. This line will fail when data is a multi-dimensional cell array.

The fix for this is to pass "all" as an argument to the all() function. The new line would be:

if (all(cellfun(@ischar, data),"all") && exist('string') && opt.stringarray)
fangq commented 1 month ago

thanks for reporting

can you submit a PR for this change, so we can document your contribution? please also provide an representative example showing this behavior