%filtered remap2 data to find template spikes orgdata=[]; for i=1:length(dataStruct.data) temp=dataStruct.data(i); temp=temp{:,:}; temp=temp(1001:end,:); orgdata=[orgdata;temp]; end data=orgdata; %finding template spikes plot([1:length(data(:,i))]'/20000,data(:,60)); 3.5*std(data(:,60)) xlabel('Time (s)'); ylabel('Voltage (mv)'); title('Spike Shape 6','fontsize',12,'fontweight','bold'); %graphing template spikes plot([1:length(template_spike10)]'/20000,template_spike10); xlabel('Time (s)'); ylabel('Voltage (mv)'); title('Spike Shape 10','fontsize',12,'fontweight','bold'); %constructing template_spike6 template_spike6=template_spike3(end:-1:1,1) %constructing template_spike7 template_spike7=template_spike4(1:2,1); for i=1:10 template_spike7=[template_spike7; template_spike4(3,1)]; end template_spike7=[template_spike7; template_spike4(4:end,1)]; %constructing template_spike8 template_spike8=template_spike1(1:5,1); for i=1:10 template_spike8=[template_spike8; template_spike1(6,1)]; end template_spike8=[template_spike8; template_spike1(7:end,1)]; %constructing template_spike9; template_spike9=template_spike5; template_spike9(14:24,1)=0; %constructing template_spike10; template_spike10=template_spike9*-1; %saving template spikes template_spikes=cell(10,1); template_spikes{1,1}=template_spike1; template_spikes{2,1}=template_spike2; template_spikes{3,1}=template_spike3; template_spikes{4,1}=template_spike4; template_spikes{5,1}=template_spike5; template_spikes{6,1}=template_spike6; template_spikes{7,1}=template_spike7; template_spikes{8,1}=template_spike8; template_spikes{9,1}=template_spike9; template_spikes{10,1}=template_spike10; save('template_spikes.mat','template_spikes');