From ca8a1ac99f975c62f01aeac3e24e27b3282f94f8 Mon Sep 17 00:00:00 2001
From: Tamas Borbath <tamas.borbath@tuebingen.mpg.de>
Date: Tue, 25 May 2021 15:58:19 +0200
Subject: [PATCH] Moved the table from evaluateProFitFittingParameters to an
 Excel file

---
 .../evaluateProFitFittingParameters.m         | 35 ++++++++++++-------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/createTestData/evaluateProFitFittingParameters.m b/createTestData/evaluateProFitFittingParameters.m
index df93d77..030808a 100644
--- a/createTestData/evaluateProFitFittingParameters.m
+++ b/createTestData/evaluateProFitFittingParameters.m
@@ -4,8 +4,8 @@ folderName = 'final_simulations';
 exportFolder = {'11 Simulations'};
 pathNameExport = 'ProFit test data';
 pathBaseExportFiles = pathToDataFolder(pathNameExport, exportFolder);
-% pathBaseExportFiles = pathBaseExportFiles(1:end-1);
-% pathBaseExportFiles = [pathBaseExportFiles ' - R3\'];
+pathBaseExportFiles = pathBaseExportFiles(1:end-1);
+pathBaseExportFiles = [pathBaseExportFiles ' - R3_new\'];% _only %+FID
 dataExportPathBase = strcat(pathBaseExportFiles, exportFolder{1}, '\');
 truncSuffix = '_truncOn';
 folderFigures = [pathBaseExportFiles 'Output\' folderName, truncSuffix, '\'];
@@ -16,8 +16,8 @@ folders = {'df2', 'pc1', 'pc0', 'gauss'};
 folders = {'df2_global', 'df2_local', 'pc1', 'pc0', 'gauss', 'em', 'noise', 'baseline'};
 folders = {'pc0',                 'pc1',           'gauss',     'df2_global',         'df2_local',        ...
     'em',              'noise',    'baseline'};
-xAxisLabels = {'$$\varphi_0$$', '$$\varphi_1$$', '$$\nu_g$$', '$$\omega_{global}$$', '{\boldmath$\omega_{local}$}', ...
-    '{\boldmath$\nu_{e}$}', '{\boldmath$noise$}', '{\boldmath$baseline$}'};
+xAxisLabels = {'$$\rm\varphi_0$$', '$$\rm\varphi_1$$', '$$\rm\nu_g$$', '$$\rm\omega_{global}$$', '{\rm\boldmath$\omega_{local}$}', ...
+    '{\rm\boldmath$\nu_{e}$}', '{\rm\boldmath$noise$}', '{\rm\boldmath$baseline$}'};
 legendLabels = {'\varphi_0 :\hspace{3em}', '\varphi_1 :\hspace{3.em}', '\nu_g :\hspace{3.em}', '\omega_{global} :\hspace{1.5em}', '${\boldmath$\omega_{local}$}$:\hspace{1.7em}', ...
     '${\boldmath$\nu_{e}$}$:\hspace{3.5em}', '${\boldmath$noise$}$:\hspace{1.5em}', '${\boldmath$baseline$}$:'};
 
@@ -40,9 +40,15 @@ if useSubPlots
 else
     numParam = length(parameters);
 end
+
+tableDeviations = cell(9,7);
+for iFolder = 1:length(folders)
+   tableDeviations{iFolder+1,1} = legendLabels{iFolder};
+end    
 for iParam = 1: numParam
     legendLabels_ = {};
     unitLabel = [titleLabels{iParam}, units{iParam}];
+    tableDeviations{1,iParam+1} = unitLabel;
     for iFolder = 1:length(folders)
         load([dataExportPathBase, folders{iFolder}, '\Diff_Summaries', truncSuffix, '_no_BL_df3.mat'], 'diff_conc_mat', 'diff_em_mat', 'diff_gm_mat', ...
             'diff_pc0_mat', 'diff_df2_mat', 'diff_pc12_mat', 'diff_T2_mat');
@@ -71,19 +77,24 @@ for iParam = 1: numParam
         else
             scatter(zeros(1,size2)+iFolder, mean(diff_mat));
         end
-        title(['$$', titleLabels{iParam}, '$$'],'Interpreter','latex');
-        legendLabels_{iFolder}= ['$$' legendLabels{iFolder}, num2str(diff_mean,'%.2f'), ' \pm ', num2str(diff_std,'%.2f'), '$$'];
-        lgd = legend(legendLabels_,'Interpreter','latex','Location','northwest');
+        title(['$$\rm', titleLabels{iParam}, '$$'],'Interpreter','latex');
+        deviationsString = [ num2str(diff_mean,'%.2f'), ' \pm ', num2str(diff_std,'%.2f')];
+        tableDeviations{iFolder+1,iParam+1} = deviationsString;
+%         legendLabels_{iFolder}= ['$$\rm' legendLabels{iFolder}, deviationsString, '$$'];
+%         lgd = legend(legendLabels_,'Interpreter','latex','Location','northwest');
         
-        title(lgd,{'$$Spectra\,\,with\,\,induced$$',['$$', titleOffset{iParam}, unitLabel,'$$']},'FontSize',8);
+%         title(lgd,{'$$\rm Spectra\,\,with\,\,induced$$',['$$\rm', titleOffset{iParam}, unitLabel,'$$']},'FontSize',8);
     end
     xlim([0, length(folders)+1]);
     xticks(1:length(folders));
     xticklabels(xAxisLabels);
-    xlabel('Simulations')
-    set(gca,'YAxisLocation','right')
-    ylabel(['$$', unitLabel, '$$'],'Interpreter','latex');
+%     xlabel('Simulations')
+    xlabel('Spectra with induced variations in ')
+%     set(gca,'YAxisLocation','right')
+    ylabel(['$$\rm', unitLabel, '$$'],'Interpreter','latex');
     set(gca,'TickLabelInterpreter','latex')
     set(gca,'XTickLabelRotation',60)
     savefig([folderFigures, parameters{iParam}])
-end
\ No newline at end of file
+end
+
+writecell(tableDeviations,[folderFigures, 'Params.xlsx'])
\ No newline at end of file
-- 
GitLab