Commit 37cf998b authored by Mark Müller-Giebeler's avatar Mark Müller-Giebeler

in older Matlab versions only char arrays work as dynamic field names of structs

parent 0557eb19
......@@ -78,13 +78,13 @@ columnHeaders = char(metaData(end));
columnHeaders = strsplit(columnHeaders(3:end),',');
idxExtraParameter = ~contains(columnHeaders, '@') & ~strcmpi(columnHeaders, 'x') & ~strcmpi(columnHeaders, 'y') & ~strcmpi(columnHeaders, 'z');
nMerges = 0;
for idxMerge = find(idxExtraParameter)
idxSource = idxMerge-nMerges;
idxTarget = idxSource-1;
columnHeaders{idxTarget} = [columnHeaders{idxTarget} columnHeaders{idxSource}];
columnHeaders(idxSource) = [];
nMerges = nMerges+1;
end
% for idxMerge = find(idxExtraParameter)
% idxSource = idxMerge-nMerges;
% idxTarget = idxSource-1;
% columnHeaders{idxTarget} = [columnHeaders{idxTarget} columnHeaders{idxSource}];
% columnHeaders(idxSource) = [];
% nMerges = nMerges+1;
% end
%--Numeric Data---
try
......@@ -190,10 +190,10 @@ end
%% parse Data
freqData = numericCsvData(:, colIdxFreqData);
for iPhysic = 1:numel(physics)
currPhysics = string(physics(iPhysic));
currPhysics = char(physics(iPhysic));
for iVariable = 1:numel(variables)
currVariable = string(variables(iVariable));
currVariable = char(variables(iVariable));
if isempty(additionalParameters)
structOut.(currPhysics).(currVariable) = parseFreqParameterData(freqData, organizedHeaderData, coords, freqVector, currPhysics, currVariable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment