remove underscores from funktion names

This commit is contained in:
2015-11-22 13:02:25 +01:00
parent a945268bee
commit 0e196d5e80
6 changed files with 24 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
function [time, rate] = binned_rate(spike_times, bin_width, dt, t_max)
% Calculates the firing rate with the binning method. The hist funciton is
% used to count the number of spikes in each bin.
function [time, rate] = binnedRate(spike_times, bin_width, dt, t_max)
% Calculates the firing rate with the binning method. The hist
% function is used to count the number of spikes in each bin.
% Arguments:
% spike_times, vector containing the times of the spikes.
% bin_width, the width of the bins in seconds.

View File

@@ -1,8 +1,9 @@
function [time, rate] = convolution_rate(spike_times, sigma, dt, t_max)
function [time, rate] = convolutionRate(spike_times, sigma, dt, t_max)
% Calculates the firing rate with the convolution method.
% Arguments:
% spike_times, a vector containing the spike times.
% sigma, the standard deviation of the Gaussian kernel in seconds.
% sigma, the standard deviation of the Gaussian kernel
% in seconds.
% dt, the temporal resolution in seconds.
% t_max, the trial duration in seconds.
%
@@ -12,13 +13,13 @@ time = 0:dt:t_max - dt;
rate = zeros(size(time));
spike_indices = round(spike_times / dt);
rate(spike_indices) = 1;
kernel = gauss_kernel(sigma, dt);
kernel = gaussKernel(sigma, dt);
rate = conv(rate, kernel, 'same');
end
function y = gauss_kernel(s, step)
function y = gaussKernel(s, step)
x = -4 * s:step:4 * s;
y = exp(-0.5 .* (x ./ s) .^ 2) ./ sqrt(2 * pi) / s;
end

View File

@@ -1,4 +1,4 @@
function [time, rate] = instantaneous_rate(spike_times, dt, t_max)
function [time, rate] = instantaneousRate(spike_times, dt, t_max)
% Function calculates the firing rate as the inverse of the interspike
% interval.
% Arguments:
@@ -6,7 +6,7 @@ function [time, rate] = instantaneous_rate(spike_times, dt, t_max)
% dt, the temporal resolutions of the recording.
% t_max, the duration of the trial.
%
% Returns the vector representing time and a vector containing the rate.
% Returns two vectors containing the time and the rate.
time = 0:dt:t_max-dt;
rate = zeros(size(time));