-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcellfigures2.m
60 lines (52 loc) · 1.65 KB
/
cellfigures2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function cellfigures2(SortedRP,fra,rep,att_num,freq_num,ISI,win)
figure
%FRA's of all cells
subplot(5,5,[4 5 9 10])
imagesc(fra)
set(gca,...
'YDir','reverse',...
'XTick',freq_num,'XTicklabel',num2str(freq_num),'box','off')
%Rasters
subplot(5,5,[11:13 16:18 21:23])
% for j=1:length(SortedRP)
%
% numSpikesForRow=length(find(SortedRP(j,:)));
% spikeIndices=find(SortedRP(j,:));
%
% plot(spikeIndices,j*ones(1,numSpikesForRow),'k.','markersize',0.5)
% hold all
% end;
% set(gca,'XTick',[100 200],'XTicklabel',{'0','100'},'box','off')
% xlim([0 size(SortedRP,2)]);ylim([0 size(SortedRP,1)])
for j=1:size(SortedRP,1)
numSpikesForRow=length(find(SortedRP(j,:)));
spikeIndices=find(SortedRP(j,:));
for i=1:numSpikesForRow
line([spikeIndices(i) spikeIndices(i)],[j-2 j+2],[1 1],'LineStyle','-','linewidth',6,'color','k')
end;
end;
set(gca,'YTick',zeros(1,0),...
'XTick',[100 200],'XTicklabel',{0,100},'FontSize',20,'box','off')
xlim([0 size(SortedRP,2)]);ylim([0 size(SortedRP,1)])
%
subplot(5,5,[1:3 6:8])
psthh=sum(SortedRP);
psth=sum(reshape(psthh,10,[]),1)./(10*size(SortedRP,1)*0.001);
plot(smooth(psth,1),'k','linewidth',3)
set(gca,...
'XTickLabel',{},...
'box','off')
xlim([1 (100+ISI)/10])
% hold on
% plot(round(win/10),zeros(1,length(win)),'r.')
subplot(5,5,[14 19 24])
ps=sum(SortedRP(:,win),2);
plot(smooth(ps,15),'k','linewidth',2)
set(gca,...
'XTickLabel',{},...
'XTick',[],'box','off','CameraUpVector',[1 0 0])
hold on
[d v]=max(ps);
plot(d,0,'r.')
%title(0.2,0.2,['Name=' name num2str(MiceNames) ' ' cellnum])
end