Skip to content

Commit

Permalink
scalar and variablelengthstring can not use with deflate on
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Nov 27, 2023
1 parent 322b798 commit a88c2e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions loadh5.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
%

path = '';
opt = struct;
if (bitand(length(varargin), 1) == 0)
opt = varargin2struct(varargin{:});
elseif (length(varargin) >= 3)
Expand Down
4 changes: 3 additions & 1 deletion saveh5.m
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ function saveh5(data, fname, varargin)
h5_chunk_dims = fliplr(chunksize);
H5P.set_chunk(pd, h5_chunk_dims);
H5P.set_deflate(pd, complevel);
opt.scalar = 0;
opt.variablelengthstring = 0;
else
error('Filter %s is unsupported', usefilter);
end
Expand Down Expand Up @@ -293,7 +295,7 @@ function saveh5(data, fname, varargin)
if (isa(item, 'string') && length(item) > 1)
itemsize = H5S.create_simple(ndims(item), fliplr(size(item)), fliplr(size(item)));
end
elseif (isnumeric(item) && numel(item) == 1 && forcedim == 0 && ndims(item) == 2 && opt.scalar)
elseif (isnumeric(item) && numel(item) == 1 && ndims(item) == 2 && opt.scalar)
itemsize = H5S.create('H5S_SCALAR');
else
itemsize = H5S.create_simple(ndims(item), fliplr(size(item)), fliplr(size(item)));
Expand Down

0 comments on commit a88c2e1

Please sign in to comment.