Authored by Anthony Boyer

Fix index error (Matlab starts at 1).

@@ -116,8 +116,8 @@ function ImaGIN_SpikesDetection(S) @@ -116,8 +116,8 @@ function ImaGIN_SpikesDetection(S)
116 chunk_nb = fix(size(timeseries,2)/chunk_length); 116 chunk_nb = fix(size(timeseries,2)/chunk_length);
117 if chunk_nb>0 117 if chunk_nb>0
118 for kk=1:chunk_nb 118 for kk=1:chunk_nb
119 - idx_start = (kk-1)*chunk_length;  
120 - idx_end = (kk)*chunk_length; 119 + idx_start = ((kk-1)*chunk_length)+1;
  120 + idx_end = ((kk)*chunk_length);
121 chunk_timeseries = timeseries(:,idx_start:idx_end); 121 chunk_timeseries = timeseries(:,idx_start:idx_end);
122 chunk_zeroed = zeroed(:,idx_start:idx_end); 122 chunk_zeroed = zeroed(:,idx_start:idx_end);
123 chunk_table{end+1} = spikes_from_monopolar(srate,labels,chunk_timeseries,chunk_zeroed,coordinates,path_out); 123 chunk_table{end+1} = spikes_from_monopolar(srate,labels,chunk_timeseries,chunk_zeroed,coordinates,path_out);