Skip to content

Commit faec25e

Browse files
committed
h4size: correct indexing
1 parent b3a8f16 commit faec25e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

+stdlib/h4size.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88

99
function fsize = h4size(file, variable)
1010
arguments
11-
file {mustBeTextScalar}
12-
variable {mustBeTextScalar}
11+
file
12+
variable (1,1) string
1313
end
1414

1515
sds = hdfinfo(file).SDS;
1616

17-
i = string(sds.Name) == variable;
18-
if ~all(i)
17+
i = {sds.Name} == variable;
18+
if ~any(i)
1919
error(variable + " is not an SDS in " + file)
2020
end
2121

22-
fsize = cell2mat({sds(i).Dims.Size});
22+
fsize = [sds(i).Dims.Size];
2323

2424
end

0 commit comments

Comments
 (0)