Browse Source

one_trial_length and filesep

Valerii Chirkov 3 years ago
parent
commit
35bb559372
1 changed files with 5 additions and 6 deletions
  1. 5 6
      code_MATLAB/Figure_1.m

+ 5 - 6
code_MATLAB/Figure_1.m

@@ -3,9 +3,6 @@ function fig = Figure_1(file_path, varargin)
 %
 % include plotting toolbox gramm: https://github.com/piermorel/gramm
 %
-% neuron: neurons' number
-% SPIKES.spikes: neurons x [time; condition; trial timing]
-% SPIKES.spikes_wave: neurons x [mean; std]
 %
 
 if(nargin>1)
@@ -17,7 +14,7 @@ end
 neurons = 1;
 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);
     
     block = f.blocks{1};
     group_SpikeTimes = block.openGroup('Spike times');
@@ -52,9 +49,11 @@ end
 %%
 % FR all
 FR_all = [];
+one_trial_length = 26; % seconds
 for i = 1:length(SPIKES)
     n_trials = max(SPIKES(i).spikes(:, 2));
-    FR_all = [ FR_all  length(SPIKES(i).spikes(:,1)) / n_trials*0.026];
+    full_time = one_trial_length*n_trials;
+    FR_all = [ FR_all  length(SPIKES(i).spikes(:,1)) / full_time];
 end
 % ISI
 isis = [];
@@ -160,4 +159,4 @@ g(7).set_layout_options('position',[0 0 1 1])
 g.draw();
 print('-dtiff','-r300','fig_1.tiff')
 
-end
+end