We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef94843 commit e65dc1cCopy full SHA for e65dc1c
+stdlib/+hdf5nc/auto_chunk_size.m
@@ -17,8 +17,8 @@
17
TYPESIZE = 8; % bytes, assume real64 for simplicity
18
19
csize = dims;
20
-Ndim = length(dims);
21
-if Ndim == 1 || prod(dims) * TYPESIZE < CHUNK_MIN
+
+if isscalar(dims) || prod(dims) * TYPESIZE < CHUNK_MIN
22
return
23
end
24
@@ -33,7 +33,7 @@
33
i = 0;
34
while true
35
% Repeatedly loop over the axes, dividing them by 2.
36
- % Stop when:
+ % Stop when:
37
% 1a. We're smaller than the target chunk size, OR
38
% 1b. We're within 50% of the target chunk size, AND
39
% 2. The chunk is smaller than the maximum chunk size
@@ -50,7 +50,7 @@
50
break
51
52
% Element size larger than CHUNK_MAX
53
- j = mod(i, Ndim) + 1;
+ j = mod(i, length(dims)) + 1;
54
csize(j) = ceil(csize(j) / 2);
55
i = i+1;
56
0 commit comments