diff --git a/+io/mapData2H5.m b/+io/mapData2H5.m index 7aba50ad..f318d1d2 100644 --- a/+io/mapData2H5.m +++ b/+io/mapData2H5.m @@ -62,7 +62,11 @@ % encode as int8 values. data = int8(data); case 'char' - data = mat2cell(data, size(data, 1)); + if isempty(data) + data = {}; + else + data = mat2cell(data, size(data, 1)); + end case {'cell', 'datetime'} if isdatetime(data) data = num2cell(data);