diff --git a/EPR_script.m b/EPR_script.m index 5b7c4f9..d207223 100644 --- a/EPR_script.m +++ b/EPR_script.m @@ -17,6 +17,8 @@ position3 = [-1250,50,1200,600]; % specify dir for printing figures figdir = './'; +% specifiy excel-file for saving parameters +table_path = 'example_results.xlsx'; %% loading Data path = input('Path to dataset: ','s'); @@ -26,9 +28,9 @@ whos % what variables have been loaded params % what information is contained in the structure called 'params' % get name of dataset -dataname = extractBefore(extractAfter(path,asManyOfPattern(wildcardPattern + "/")),'.'); - -gpuData = gpuArray(Data); % using Parallel Computing toolbox to speed up +dataname = string(extractBefore(extractAfter(path,asManyOfPattern(wildcardPattern + "/")),'.')); +% using Parallel Computing toolbox to speed up (check with "gpuDevice" if you can use this) +gpuData = gpuArray(Data); %% Baseline Correcting % plot the raw data & check the number of points before the signal (pre-trigger) @@ -188,7 +190,7 @@ while simu_proceed == 'n' end end -%% printing figures and saving parameters +%% printing figures printing = input('Do you want to print figure(3)? [y/n]: ','s'); if printing == 'y' figure(3) @@ -197,3 +199,19 @@ if printing == 'y' set(gcf,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)]); print(gcf,strcat(figdir,dataname),'-dpdf','-r0'); end + +%% saving parameters + % concatenate data to existing table +table_old = readtable(table_path); +table_old.Properties.VariableNames = {'filename', 'date', 'pre-trigger', ... + 'baseline_points', 'max_area_left', 'max_area_right', 'T_x', 'T_y', 'T_z', ... + 'sim. g-value', 'sim_D', 'sim_E', 'sim_lw_gauss', 'sim_lw_lorentz'}; +% new data as table +table_new = table(dataname, string(datestr(clock)), pre_trigger, baseline_points, ... + max_region(1), max_region(end), Exp.Temperature(1), Exp.Temperature(2), Exp.Temperature(3), ... + BestSys.g, BestSys.D(1), BestSys.D(2), BestSys.lw(1), BestSys.lw(2), ... + 'VariableNames', {'filename', 'date', 'pre-trigger', 'baseline_points', ... + 'max_area_left', 'max_area_right', 'T_x', 'T_y', 'T_z', 'sim. g-value', ... + 'sim_D', 'sim_E', 'sim_lw_gauss', 'sim_lw_lorentz'}); +table_conc = [table_old;table_new]; +writetable(table_conc,table_path) diff --git a/example_results.xlsx b/example_results.xlsx new file mode 100644 index 0000000..7f6af96 Binary files /dev/null and b/example_results.xlsx differ