function [m]=my_analyzenetwork(spikes,stimulatednode,maxdelay) %Analyze Toy Network networksize=size(spikes); networksize=networksize(1,2); found=zeros(1,networksize); for i=1:networksize %reports if j is causing i disp(sprintf(' Neuron %d interaction . . .', i)) if i~=stimulatednode xcorrtemp=xcorr(full(spikes(:,i)),full(spikes(:,stimulatednode)),maxdelay); xcorrtemp=xcorrtemp(maxdelay+1:end); %needed for matlab version of xcorr (must be commented out for jkarr version of xcorr). [Y, I]=max(xcorrtemp); found(1,i)=sqrt(-1)*I(1)+Y(1); else found(1,i)=0; end end [m]=found;