diff --git a/pointprocesses/code/isiHist.m b/pointprocesses/code/isihist.m similarity index 75% rename from pointprocesses/code/isiHist.m rename to pointprocesses/code/isihist.m index 4f28f32..33ad4f5 100644 --- a/pointprocesses/code/isiHist.m +++ b/pointprocesses/code/isihist.m @@ -1,7 +1,7 @@ -function [pdf, centers] = isiHist(isis, binwidth) +function [pdf, centers] = isihist(isis, binwidth) % Compute normalized histogram of interspike intervals. % -% [pdf, centers] = isiHist(isis, binwidth) +% [pdf, centers] = isihist(isis, binwidth) % % Arguments: % isis: vector of interspike intervals in seconds @@ -14,15 +14,15 @@ function [pdf, centers] = isiHist(isis, binwidth) if nargin < 2 % compute good binwidth: nperbin = 200; % average number of data points per bin - bins = length( isis )/nperbin; % number of bins - binwidth = max( isis )/bins; + bins = length(isis)/nperbin; % number of bins + binwidth = max(isis)/bins; if binwidth < 5e-4 % half a millisecond binwidth = 5e-4; end end bins = 0.5*binwidth:binwidth:max(isis); % histogram data: - [ nelements, centers ] = hist(isis, bins); + [nelements, centers] = hist(isis, bins); % normalization (integral = 1): pdf = nelements / sum(nelements) / binwidth; end diff --git a/pointprocesses/code/isis.m b/pointprocesses/code/isis.m index b927abd..65a346b 100644 --- a/pointprocesses/code/isis.m +++ b/pointprocesses/code/isis.m @@ -1,7 +1,7 @@ -function isivec = isis( spikes ) +function isivec = isis(spikes) % returns a single list of isis computed from all trials in spikes % -% isivec = isis( spikes ) +% isivec = isis(spikes) % % Arguments: % spikes: a cell array of vectors of spike times in seconds @@ -12,9 +12,9 @@ function isivec = isis( spikes ) isivec = []; for k = 1:length(spikes) - difftimes = diff( spikes{k} ); + difftimes = diff(spikes{k}); % difftimes(:) ensures a column vector % regardless of the type of vector in spikes{k} - isivec = [ isivec; difftimes(:) ]; + isivec = [isivec; difftimes(:)]; end end diff --git a/pointprocesses/code/spikeraster.m b/pointprocesses/code/spikeraster.m index cde46dc..a20b0df 100644 --- a/pointprocesses/code/spikeraster.m +++ b/pointprocesses/code/spikeraster.m @@ -13,18 +13,17 @@ for k = 1:ntrials times = 1000.0*times; % conversion to ms end for i = 1:length( times ) - line([times(i) times(i)],[k-0.4 k+0.4], 'Color', 'k' ); + line([times(i) times(i)],[k-0.4 k+0.4], 'Color', 'k'); end end if tmax < 1.5 - xlabel( 'Time [ms]' ); + xlabel('Time [ms]'); xlim([0.0 1000.0*tmax]); else - xlabel( 'Time [s]' ); + xlabel('Time [s]'); xlim([0.0 tmax]); end -ylabel( 'Trials'); -ylim( [ 0.3 ntrials+0.7 ] ) - +ylabel('Trials'); +ylim([0.3 ntrials+0.7 ]); end