Skip to content

Commit

Permalink
Fix empty strings mapping to non-empty cells
Browse files Browse the repository at this point in the history
Very important before writing to dataset
  • Loading branch information
lawrence-mbf committed Jul 28, 2023
1 parent 68bf2d2 commit 8524cde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion +io/mapData2H5.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8524cde

Please sign in to comment.