view aim-mat/tools/@signal/generatefromspiketrain.m @ 0:74dedb26614d

Initial checkin of AIM-MAT version 1.5 (6.4.2011).
author tomwalters
date Fri, 20 May 2011 12:32:31 +0100
parents
children 20ada0af3d7d
line wrap: on
line source
function sig=generatefromspiketrain(sig,st)

vals=zeros(size(getvalues(sig)));
times=time2bin(sig,st);

maxval=length(vals);
selecttimes=times(find(times>0 & times<maxval));
% sig=addtimevalue(sig,selecttimes,1);
vals(round(selecttimes))=vals(round(selecttimes))+1;

sig=setvalues(sig,vals);