% cleanup measurement data % remove fots from files % merge measurments into database if 1 folderPath = "/Volumes/NT-Labor/2024/sioe/High Speed Messungen Oktober/mpi_measurement"; % Get list of all files in the folder and subfolders fileList = dir(fullfile(folderPath, '**', '*')); % Loop through each file big_wh_list = {}; small_wh_list = {}; for i = 1:length(fileList) fileName = fileList(i).name; iswh = strfind(fileName, 'wh'); if ~isempty(iswh) wh = load(fullfile(fileList(i).folder, fileName)); wh = wh.obj; if isa(wh,'DataStorage') if prod(wh.dim) > 2 big_wh_list{end+1} = wh; else small_wh_list{end+1} = wh; end end end end end %%% merge MPI structs by copying the values %%% params.M = [4,6,8]; params.bitrate = [224,336,448].*1e9; params.duobinary = [0,1]; params.interference_atten = [0 3 6 9 12 15 18 21 24 27 30 45]; wh_new=DataStorage(params); for w = 1:numel(big_wh_list) wh = big_wh_list{w}; for m = wh.parameter.M.values for br = wh.parameter.bitrate.values for db = wh.parameter.duobinary.values for iatten = wh.parameter.interference_atten.values storage_names = fieldnames(wh.sto); for i = 1:length(storage_names) %get two things: %1) current data storage name cur_storage = storage_names{i}; %2) the value saved at this storage and dimension value = wh.getStoValue(cur_storage,m,br,db,iatten); % check if storage name already exists, if not % .addStorgae(...) if ~isfield(wh_new.sto,cur_storage) wh_new.addStorage(cur_storage); end if isempty(wh_new.getStoValue(cur_storage,m,br,db,iatten)) % Finally, add the value to the repsective storage wh_new.addValueToStorage(value,cur_storage,m,br,db,iatten); else warning('double vaue?') end end end end end end end