File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 66% * variable: path of variable in file
77% %% Outputs
88% * exists: boolean
9- arguments
10- file
11- variable (1 ,1 ) string
12- end
9+ % arguments
10+ % file
11+ % variable (1,1) string
12+ % end
1313
14- sds = hdfinfo(file ).SDS;
14+ finf = hdfinfo(file );
15+ sds = finf .SDS ;
1516exists = ismember(variable , sds .Name );
1617
1718end
Original file line number Diff line number Diff line change 77% fsize: vector of variable size per dimension. Empty if scalar variable.
88
99function fsize = h4size(file , variable )
10- arguments
11- file
12- variable (1 ,1 ) string
13- end
10+ % arguments
11+ % file
12+ % variable (1,1) string
13+ % end
1414
15- sds = hdfinfo(file ).SDS;
15+ finf = hdfinfo(file );
16+ sds = finf .SDS ;
1617
17- i = {sds .Name } == variable ;
18+ i = strcmp( {sds .Name }, variable ) ;
1819if ~any(i )
1920 error(variable + " is not an SDS in " + file )
2021end
Original file line number Diff line number Diff line change 11classdef (SharedTestFixtures = { matlab .unittest .fixtures .PathFixture(fileparts(fileparts(mfilename(' fullpath' ))))}, ...
2- TestTags = {' R2019b ' , ' hdf4' }) ...
2+ TestTags = {' R2017b ' , ' hdf4' }) ...
33 TestHDF4 < matlab .unittest .TestCase
44
55properties
88
99methods (TestClassSetup )
1010function check_file(tc )
11- tc .assumeThat( tc .file , matlab . unittest . constraints . IsFile )
11+ tc .assumeTrue(isfile( tc .file ), " HDF4 file not found: " + tc . file )
1212end
1313end
1414
You can’t perform that action at this time.
0 commit comments