File tree Expand file tree Collapse file tree 6 files changed +20
-4
lines changed Expand file tree Collapse file tree 6 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 11
11
12
12
arguments
13
13
file (1 ,1 ) string {mustBeFile }
14
- variable (1 ,1 ) string {mustBeNonzeroLengthText }
14
+ variable string {mustBeScalarOrEmpty }
15
+ end
16
+
17
+ if isempty(variable ) || strlength(variable ) == 0
18
+ frank = [];
19
+ return
15
20
end
16
21
17
22
dsi = h5info(stdlib .fileio .expanduser(file ), variable ).Dataspace;
Original file line number Diff line number Diff line change 7
7
% variable: name of variable inside file
8
8
%
9
9
% %% Outputs
10
- % fsize: vector of variable size per dimension
10
+ % fsize: vector of variable size per dimension. Empty if scalar variable.
11
11
12
12
arguments
13
13
file (1 ,1 ) string {mustBeFile }
Original file line number Diff line number Diff line change 11
11
12
12
arguments
13
13
file (1 ,1 ) string {mustBeFile }
14
- variable (1 ,1 ) string {mustBeNonzeroLengthText }
14
+ variable string {mustBeScalarOrEmpty }
15
+ end
16
+
17
+ if isempty(variable ) || strlength(variable ) == 0
18
+ frank = [];
19
+ return
15
20
end
16
21
17
22
dsi = ncinfo(stdlib .fileio .expanduser(file ), variable );
Original file line number Diff line number Diff line change 7
7
% variable: name of variable inside file
8
8
%
9
9
% %% Outputs
10
- % fsize: vector of variable size per dimension
10
+ % fsize: vector of variable size per dimension. Empty if scalar variable.
11
11
12
12
arguments
13
13
file (1 ,1 ) string {mustBeFile }
Original file line number Diff line number Diff line change @@ -130,6 +130,9 @@ function test_size(tc)
130
130
import stdlib .hdf5nc .h5ndims
131
131
basic = tc .TestData .basic ;
132
132
133
+ tc .verifyEmpty(h5ndims(basic , string .empty ))
134
+ tc .verifyEmpty(h5ndims(basic , " " ))
135
+
133
136
if ~verLessThan(' matlab' , ' 9.8' )
134
137
r = h5ndims(basic , ' /A0' );
135
138
s = h5size(basic , ' /A0' );
Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ function test_size(tc)
118
118
import matlab .unittest .constraints .IsScalar
119
119
basic = tc .TestData .basic ;
120
120
121
+ tc .verifyEmpty(ncndims(basic , string .empty ))
122
+ tc .verifyEmpty(ncndims(basic , " " ))
123
+
121
124
r = ncndims(basic , ' A0' );
122
125
s = ncsize(basic , ' A0' );
123
126
tc .verifyEmpty(s )
You can’t perform that action at this time.
0 commit comments