-
Notifications
You must be signed in to change notification settings - Fork 2
/
aGC_plotVoltStepsExp.m
68 lines (61 loc) · 1.92 KB
/
aGC_plotVoltStepsExp.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
61
62
63
64
65
66
67
68
function aGC_plotVoltStepsExp(loadingfile,targetfolder_results,ostruct)
if nargin < 3
ostruct = [];
end
steps = -120-12.1;
if ~isfield(ostruct,'subtract_hv')
ostruct.subtract_hv = 0;
end
load(loadingfile,'neuron')
[exp_vclamp,vsteps,rate] = load_ephys(ostruct.dataset,'VClamp');
if isfield(ostruct,'handles') && ishandle(ostruct.handles(1))
fig(1) = ostruct.handles(1);
figure(fig(1))
else
fig(1) = figure;
end
hold all
if isfield(ostruct,'handles') && numel(ostruct.handles)>1 && ishandle(ostruct.handles(2))
fig(2) = ostruct.handles(2);
figure(fig(2))
ax=gca;
else
fig(2) = figure;ax=axes;
end
hold all
if ostruct.subtract_hv
basel = mean(exp_vclamp(0*rate+1:104*rate+1,:,:),1);
exp_vclamp = exp_vclamp(:,:,:) - repmat(basel,size(exp_vclamp,1),1,1); % subtract current at baseline holding voltage (as Mongiat did)
end
str = '';
figure(fig(1))
for f = 1:size(exp_vclamp,2)
for s = 1:size(exp_vclamp,3)
subplot(floor(sqrt(size(exp_vclamp,3))),ceil(sqrt(size(exp_vclamp,3))),s)
hold all
plot(1/rate:1/rate:size(exp_vclamp,1)/rate,squeeze(exp_vclamp(:,f,s)))
ylabel('Current [pA]')
xlabel('Time [ms]')
ylim([-200,200])
title(sprintf('VClamp % 4.4g mV%s',vsteps(s),str));
xlim([0 300])
if any(vsteps(s) == steps)
plot(ax,1/rate:1/rate:size(exp_vclamp,1)/rate,squeeze(exp_vclamp(:,f,s)))
ylabel('Current [pA]')
xlabel('Time [ms]')
ylim([-400,200])
title(sprintf('VClamp % 4.4g mV%s',vsteps(s),str));
xlim([0 300])
end
end
end
figure(fig(2))
FontResizer
FigureResizer(ostruct.figureheight,ostruct.figurewidth)
if isfield(ostruct,'savename')
if ~isempty(ostruct.savename)
tprint(fullfile(targetfolder_results,ostruct.savename),'-pdf');
end
else
tprint(fullfile(targetfolder_results,expcat('IV_dyn',neuron.experiment)),'-pdf');
end