function analyze_correlation_between_successive_pscs(pscmat,casecolor,livetrials_preinduc,livetrials_postinduc) %designed for testing the hypothesis that the relation between the first and second PSCs of a given sweep have a relationship at a given IPI -- does the bouton state fluctuate on these time scales? livetrials=[livetrials_preinduc(1):livetrials_postinduc(end)]; label_addendum='all trials'; markersize=4; interval_vector=pscmat(1,livetrials) psco=pscmat(3,livetrials);psco(find(psco<0))=0; psca=pscmat(4,livetrials);psca(find(psca<0))=0; possible_intervals=[25 50 100 200 400]; for present_interval=1:5 figure(possible_intervals(present_interval)),hold on good_uns=find(interval_vector==possible_intervals(present_interval)) if ~isempty(good_uns) x_vals=psco(good_uns)/mean(psco(good_uns)); y_vals=psca(good_uns)/mean(psca(good_uns)); plot(x_vals,y_vals,'o','markerfacecolor',casecolor,'markeredgecolor',casecolor,'markersize',markersize) [p,s]=polyfit(x_vals,y_vals,1) plot([0 max(x_vals)],[p(2) p(2)+p(1)*max(x_vals)],'color',casecolor,'linewidth',.1) xlabel(strcat('PSC1', label_addendum)) ylabel(strcat('PSC2', label_addendum)) title(num2str(possible_intervals(present_interval))) end end