So I have this vector with 182 elements that show me timings of a neuron's spiking activity. Each element corresponds to a time point, for e.g. 672 where 672 is in ms.
My timeline is 10s or 10000 ms.
What I need to generate is a vector with 10000 elements, where there are 1s at the times corresponding to the spike-timing matrix and 0s everywhere else.
The code I wrote shows me only one 1, that too at the last time point. Here is what I wrote -
spikes = zeros(1,length(time));
s = SpikeTimes*10;
for j = 1:length(SpikeTimes)
for i = 1:length(spikes)
if s(j) ~= i
spikes(i) = 0;
spikes(i) = 1;
Could anyone please help me out? Thanks.
I need to further use the generated spikes vector to calculate firing rate using binning, a rectangular window, a gaussian window and compare and discuss the results.