-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadParameterFits.m
More file actions
41 lines (33 loc) · 1.18 KB
/
LoadParameterFits.m
File metadata and controls
41 lines (33 loc) · 1.18 KB
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
function [params,fittedParams,CIs,goodTimePoint] = LoadParameterFits(params)
% Need parameter fitting to be performed using ComputeFittingResults
%-------------------------------------------------------------------------------
if nargin < 1
params = GiveMeDefaultParams();
end
if ~params.doSubsample
theFileName = 'parameterFits.mat';
else
theFileName = 'parameterFits_subsampled.mat';
end
if ~exist(theFileName)
error('Run ComputeFittingResults to save parameter fitting results');
end
load(theFileName,'paramFitStruct')
theField = sprintf('%s_%s',params.thisBrainDiv,params.thisCellType);
if ~isfield(paramFitStruct,theField)
error('Incomplete computation in %s: missing %s',theFileName,theField);
end
% Get fitted Params:
fittedParams = paramFitStruct.(theField).fittedParams;
% Computed CIs:
CIs = paramFitStruct.(theField).CIs;
% Good time points
goodTimePoint = paramFitStruct.(theField).goodTimePoint;
if ~params.includeAdult && (length(fittedParams)==8)
fittedParams = fittedParams(1:end-1);
CIs = CIs(1:end-1);
goodTimePoint = goodTimePoint(1:end-1);
end
% Overwrite params with the stored values from the fit:
params = paramFitStruct.(theField).params;
end