function psp_slope_intensity_measurement(celery,rawmat_cell_array) clr=colormap(jet(60)); for expt=1:length(celery) if ~isempty(celery{expt}) figure(expt+100),clf if expt>2,psps=celery{expt}(:,35:99);else psps=celery{expt}(:,35:79);end maxpsp=-inf;maxslope=-inf;maxsslope=-inf;ms=0; for sweep=1:size(psps,1) subplot(6,2,1:2),hold on,title(num2str(expt)), set(gca,'xtick',[],'ytick',[]) plot(psps(sweep,:),'color',clr(sweep,:)),ylim([-2 10]) if max(psps(sweep,:))>maxpsp,maxpsp=max(psps(sweep,:));end slope=[]; for sample=11:size(psps,2) slope(sample-10)=psps(sweep,sample)-psps(sweep,sample-10); end subplot(6,2,3:4),hold on, set(gca,'xtick',[],'ytick',[]) plot(slope,'color',clr(sweep,:)),ylim([-1 5]) if max(slope)>maxslope,maxslope=max(slope);end subplot(6,2,5:6),hold on, set(gca,'xtick',[],'ytick',[]) longest_run_variable_thresh(slope) ylim([0 1]) for ssample=11:length(slope) sslope(ssample-10)=slope(ssample)-slope(ssample-10); end if max(sslope)>maxsslope,maxsslope=max(sslope);end ms=[ms mean(sslope)];%ms+sum(sslope(find(sslope>0))); subplot(6,2,7:8),hold on, set(gca,'xtick',[],'ytick',[]) plot(sslope,'color',clr(sweep,:)),ylim([-1 4]) end subplot(6,2,1:2),ylabel(num2str(maxpsp)) subplot(6,2,3:4),ylabel(num2str(maxslope)) subplot(6,2,7:8),ylabel(num2str(1000*mean(ms))) plot([0 length(sslope)],[0 0],'k','linewidth',2) end subplot(6,2,9:12) if ~isempty(rawmat_cell_array{expt}) plot(mean(rawmat_cell_array{expt}(200:400,:)')) axis([0 200 -20 3]), set(gca,'xtick',[],'ytick',[]) end end