瀏覽代碼

clean not using code

Valerii Chirkov 3 年之前
父節點
當前提交
81108db119
共有 1 個文件被更改,包括 4 次插入18 次删除
  1. 4 18
      code_MATLAB/Figure_2.m

+ 4 - 18
code_MATLAB/Figure_2.m

@@ -2,15 +2,14 @@ function fig = Figure_2(file_path)
 
 % TO BE INCLUDED IN THE PATH
 % fieldtrip: fieldtrip-20191028 www.fieldtrip.org
-% shadeErrobar: https://nl.mathworks.com/matlabcentral/fileexchange/26311-raacampbell-shadederrorbar
-%
-% include plotting toolbox gramm: https://github.com/piermorel/gramm
+% gramm: https://github.com/piermorel/gramm
 %
+
 chs = [1 3 5 6 8 10 12]; % healthy amygdalae
 chtot = 0;
 for nSubject=1:9
     file_name = sprintf('Data_Subject_%.2d_Session_01.h5',nSubject);
-    f = nix.File([file_path,file_name],nix.FileMode.ReadOnly);
+    f = nix.File([file_path  filesep file_name],nix.FileMode.ReadOnly);
     
     sectionSession = f.openSection('Session');
     all_trials = sectionSession.openProperty('Number of trials').values{1}.value;
@@ -40,8 +39,7 @@ for nSubject=1:9
     cfg.taper        = 'hanning';
     cfg.keeptrials   = 'yes';
     cfg.foi          = logspace(log10(1),log10(100),30);  
-        cfg.foi          = linspace( 1, 100 ,50);                         % analysis 2 to 30 Hz in steps of 2 Hz
-% analysis 2 to 30 Hz in steps of 2 Hz
+    cfg.foi          = linspace( 1, 100 ,50);
     cfg.t_ftimwin    = 5./cfg.foi;   % length of time window = 0.5 sec
     cfg.toi          = -5:0.1:24;
     cfg.trials       = 2:2:17;
@@ -69,7 +67,6 @@ end
 
 %% plot Figure 2
 clear g
-%figure('Position',[100 100 800 350]);
 fig = figure;
 
 data = [PSD_face(chs,:); PSD_land(chs,:)];
@@ -84,17 +81,6 @@ g.stat_summary('setylim', true, 'type', custom_statfun);
 g.set_names( 'x', 'Frequency [Hz]', 'y', 'Power [dB]' );
 g.draw();
 
-% shadedErrorBar(ff,  10*log10(nanmean(PSD_face(chs,:))), ...
-%                 (nanstd(10*log10(PSD_face(chs,:)))/sqrt(8*6)),'r');
-% hold on;
-% shadedErrorBar(ff,  10*log10(nanmean(PSD_land(chs,:))), ...
-%                 (nanstd(10*log10(PSD_land(chs,:)))/sqrt(8*6)),'b');
-% 
-% xlabel('Frequency [Hz]')
-% ylabel('Power  [dB]')
-% 
-% text(60,14,'Neutral','fontsize',16,'color','b')
-% text(60,12,'Aversive','fontsize',16,'color','r')
 
 print('-dtiff','-r300','fig_2.tiff')