From 4877532c8e0d3536a1aacc77fb760732b12b85c7 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 8 Apr 2011 11:26:13 +0200 Subject: [PATCH] fix in ReadHDF5FieldData --- matlab/ReadHDF5FieldData.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matlab/ReadHDF5FieldData.m b/matlab/ReadHDF5FieldData.m index 03b2e5e..4d7c785 100644 --- a/matlab/ReadHDF5FieldData.m +++ b/matlab/ReadHDF5FieldData.m @@ -67,8 +67,10 @@ if (numel(FD.names)>0) ind = find(strcmp(FD.names,name)); if isempty(ind) ind = find(strcmp(FD.names,['/FieldData/FD/f' int2str(n-1)])); - hdf_fielddata.FD.values{n} = double(hdf5read(file,FD.names{ind})); - hdf_fielddata.FD.freq(n) = FD.freq(ind); + if ~isempty(ind) + hdf_fielddata.FD.values{n} = double(hdf5read(file,FD.names{ind})); + hdf_fielddata.FD.freq(n) = FD.freq(ind); + end else hdf_fielddata.FD.values{n} = double(hdf5read(file,FD.names{ind})); hdf_fielddata.FD.freq(n) = FD.freq(ind);