Aligning 5 second interval data of continuous time to the same interval

1 Ansicht (letzte 30 Tage)
I have an array of times at which neurons are firing, spike times, that are all 5 second intervals. However, these intervals are increasing due to the data recording being done at the same time. Is there a way I can zero these five second intervals so that there time stamps are over the same time scale, say 0 to 5 seconds. Basically take 5 second intervals of time stamps from 16-21 seconds or 19-34 and 'zero' them from a 0 to 5 second scale. The attached matrix has an example of time stamps within some five second intervals. The overall goal is to overlay these spike times to look at the firing rate and density etc.
Any help would be greatly appreciated. Please let me know if I need to clear anything up.

Akzeptierte Antwort

Star Strider
Star Strider am 20 Jun. 2016
I’m not sure what you want to do. Your data are also not easy for me to interperet, because they lack a time base.
See if something like this works:
d = load('Heath Robinson spks.mat');
spk = d.spk;
for k1 = 1:size(spk,2)
thrsh = mean(spk{k1}(1:5)) + 5*std(spk{k1}(1:5)); % Define Threshold
dep(k1) = find(spk{k1} >= thrsh, 1, 'first'); % Initial Value Exceeding Threshold
end
figure(1)
plot([1:size(spk{1},2)], spk{1}, dep(1),spk{1}(dep(1)), 'r^')
hold on
plot([1:size(spk{2},2)], spk{2}, dep(2),spk{2}(dep(2)), 'r^')
plot([1:size(spk{3},2)], spk{3}, dep(3),spk{3}(dep(3)), 'r^')
hold off
grid
  13 Kommentare
Krispy Scripts
Krispy Scripts am 5 Aug. 2016
Could you put the code from "out" a way that could do it to more than just three sets of spikes and intervals?
I posted it as a question here:

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Just for fun finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by