Having trouble with the spike triggered average

I keep getting empty matrices when trying to determine a spike triggered average. Below is my code. Can anyone help??
spkr=[NaN,spikes(1:end-1)]; trig_spk=find(spikes>0 & spkr<=0); x1=1:length(spikes);
y2=zeros(1,length(trig_spk)); figure;plot (x1,spikes,'g',trig_spk,y2,'.') dog=[]; cat=[]; for i=1:length(trig_spk) try dog(i,:)=binarized( trig_spk(i) : trig_spk(i)+4000-1); cat(i,:)=spikes(trig_spk(i) : trig_spk +4000-1); end; end end;

回答 (4 件)

Star Strider
Star Strider 2015 年 3 月 16 日

0 投票

I keep getting empty matrices too, because I don’t have your data.
Care to let us know what your ‘spikes’ data are?
Holly Hunsberger
Holly Hunsberger 2015 年 3 月 16 日

0 投票

Attached is the data file. Thanks!
Holly Hunsberger
Holly Hunsberger 2015 年 3 月 16 日

0 投票

Also, the window is 200ms. (200ms before a spike and after)

2 件のコメント

Star Strider
Star Strider 2015 年 3 月 16 日
When you post it, will your data also have a time variable?
Image Analyst
Image Analyst 2015 年 3 月 16 日
After you click "Choose file..." remember to click the "Attach file" button or else it won't attach.

サインインしてコメントする。

Holly Hunsberger
Holly Hunsberger 2015 年 3 月 17 日

0 投票

Time wasn't in the original data file, but I figured it out to be t=1:length(stimulus); t=t./sr;

カテゴリ

ヘルプ センター および File ExchangeElectrophysiology についてさらに検索

質問済み:

2015 年 3 月 16 日

コメント済み:

2015 年 3 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by