forked from np-crick/git-matlab-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetParameters.m
More file actions
29 lines (21 loc) · 765 Bytes
/
getParameters.m
File metadata and controls
29 lines (21 loc) · 765 Bytes
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
function [ parameters ] = getParameters( dataSet, task, parameter )
%GETPARAMETERS From a given AutonoMouse data set, return a matrix of
%parameters for a given trial where each row is an individual animal and
%each column is the chosen parameter on each trial
<<<<<<< HEAD
=======
mouseNames = fieldnames(dataSet);
allParameters = {};
for m = 1:length(mouseNames)
thisMouse = dataSet.(mouseNames{m});
thisTask = thisMouse.(task);
thisParameter = thisTask.(parameter);
allParameters{m} = thisParameter;
end
maxLength = max(cellfun(@length, allParameters));
parameters = nan(length(allParameters), maxLength);
for i = 1:length(allParameters)
parameters(i,1:length(allParameters{1,i})) = allParameters{1,i};
end
>>>>>>> upstream/master
end