matlab: enable non comlex FD dump to read

todo: the matlab function should use the number of frequencies in the hdf5 file in the future
pull/1/head
Thorsten Liebig 2011-02-03 10:41:52 +01:00
parent 6024eb1e91
commit 4dab50a3f1
1 changed files with 12 additions and 6 deletions

View File

@ -61,15 +61,21 @@ if (numel(TD.names)>0)
end end
if (numel(FD.names)>0) if (numel(FD.names)>0)
Nr_freq = numel(FD.names)/2; Nr_freq = numel(FD.names)
for n=1:Nr_freq for n=1:Nr_freq
name = ['/FieldData/FD/f' int2str(n-1) '_real']; name = ['/FieldData/FD/f' int2str(n-1) '_real'];
ind = find(strcmp(FD.names,name)); ind = find(strcmp(FD.names,name));
hdf_fielddata.FD.values{n} = double(hdf5read(file,FD.names{ind})); if isempty(ind)
hdf_fielddata.FD.freq(n) = FD.freq(ind); ind = find(strcmp(FD.names,['/FieldData/FD/f' int2str(n-1)]));
name = ['/FieldData/FD/f' int2str(n-1) '_imag']; hdf_fielddata.FD.values{n} = double(hdf5read(file,FD.names{ind}));
ind = find(strcmp(FD.names,name)); hdf_fielddata.FD.freq(n) = FD.freq(ind);
hdf_fielddata.FD.values{n} = hdf_fielddata.FD.values{n} + 1j*double(hdf5read(file,FD.names{ind})); else
hdf_fielddata.FD.values{n} = double(hdf5read(file,FD.names{ind}));
hdf_fielddata.FD.freq(n) = FD.freq(ind);
name = ['/FieldData/FD/f' int2str(n-1) '_imag'];
ind = find(strcmp(FD.names,name));
hdf_fielddata.FD.values{n} = hdf_fielddata.FD.values{n} + 1j*double(hdf5read(file,FD.names{ind}));
end
end end
end end