0001 function PlotShortTimeCCG(data,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 parent = [];
0032 x = 1:size(data,2);
0033 y = 1:size(data,1);
0034 args = {};
0035
0036 if nargin < 1,
0037 error('Incorrect number of parameters (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).');
0038 end
0039
0040
0041 j = 1;
0042 for i = 1:2:length(varargin),
0043 if ~ischar(varargin{i}),
0044 error(['Parameter ' num2str(i+2) ' is not a property (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).']);
0045 end
0046 switch(lower(varargin{i})),
0047
0048 case 'parent',
0049 parent = varargin{i+1};
0050 if ~ishandle(parent),
0051 error('Incorrect value for property ''parent'' (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).');
0052 end
0053
0054 case 'x',
0055 x = varargin{i+1};
0056 if ~isdvector(x),
0057 error('Incorrect value for property ''x'' (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).');
0058 end
0059 args{j} = varargin{i};
0060 args{j+1} = varargin{i+1};
0061 j = j + 2;
0062
0063 case 'y',
0064 y = varargin{i+1};
0065 if ~isdvector(y),
0066 error('Incorrect value for property ''y'' (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).');
0067 end
0068 args{j} = varargin{i};
0069 args{j+1} = varargin{i+1};
0070 j = j + 2;
0071
0072 case {'threshold','cutoffs','gamma','colorspace','bar','type'},
0073 args{j} = varargin{i};
0074 args{j+1} = varargin{i+1};
0075 j = j + 2;
0076
0077 otherwise,
0078 error(['Unknown property ''' num2str(varargin{i}) ''' (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).']);
0079
0080 end
0081 end
0082
0083 if isempty(parent), parent = gcf; end
0084
0085 xcorrs = round(linspace(1,size(data,2),5));
0086 for i = 1:5,
0087 subplot(5,6,6*i,'parent',parent);
0088 j = round(xcorrs(i));
0089 bar(y,data(:,j));
0090 xlim([min(y) max(y)]);
0091 xlabel(['t = ' num2str(x(j))]);
0092 set(gca,'ytick',[]);
0093 end
0094 subplot(5,6,[1 29],'parent',parent);
0095 PlotColorMap(data,1,args{:});
0096 xlabel('Time (s)');
0097 ylabel('Time shift (s)');
0098