function out = PlotISI(data,range,bin) % ISI分布と自己相関ヒストグラムの表示 % figureハンドル = PlotISI(スパイク時刻列, 試行 [開始 終了] 配列, ビン) out = figure('Position',[0 400 800 400]); Max=200-mod(200,bin); %%% ビン幅でキリよくなるように設定 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ISIヒストグラム ha=subplot('Position', [0.07 0.2 0.4 0.6]); %%% 表示位置指定 tmp=isi(link(data,range),1); %%% 試行をリンクしてからISI列 histo = hist(tmp, 0.5*bin:bin:(Max+0.5*bin))/length(tmp)/bin; %%% 幅binでヒストグラム histo(length(histo))=0; %%% 階段プロットするために最後を0に stairs(0:bin:Max, histo); %%% 階段プロットで表示 xlabel('Interval [ms]'); title('ISI histogram'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 自己相関ヒストグラム ha=subplot('Position', [0.55 0.2 0.4 0.6]); %%% 表示位置指定 tmp=lagHist(data, data, range, Max); %%% 全ての組のスパイク時刻差のヒストグラム for i=1:(length(histo)-1) histo(i)=mean(tmp(((i-1)*bin+1):(i*bin), 3)); %%% 幅 bin 内で平均をとる end histo(length(histo))=0; %%% 階段プロットするために最後を0に stairs(0:bin:Max, histo); %%% 階段プロットで表示 xlabel('Interval [ms]'); title('Auto-correlogram'); set(ha,'ylim',[0 2]); set(ha,'xlim',[0 200]);