forked from np-crick/git-matlab-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplitData.m
More file actions
38 lines (32 loc) · 870 Bytes
/
splitData.m
File metadata and controls
38 lines (32 loc) · 870 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
29
30
31
32
33
34
35
36
37
38
function [ control, test ] = splitData( dataSet )
%SPLITDATA splits a standard AutonoMouse data set into two structures, one
%for control animals, one for test animals based on NMDA parameter
<<<<<<< HEAD
names = fieldnames(dataSet);
disp(dataSet.(names{1}))
field_names = fieldnames(dataSet.(names{1}));
disp(field_names)
control = struct();
test = struct();
for i =1:numel(names)
NMDA = dataSet.(names{i}).NMDA;
if NMDA == 0
control.(names{i})=dataSet.(names{i});
else
test.(names{i}) = dataSet.(names{i});
end
end
=======
control = struct();
test = struct();
mouseNames = fieldnames(dataSet);
for m = 1:length(mouseNames)
thisMouse = dataSet.(mouseNames{m});
if thisMouse.NMDA > 0
test.(mouseNames{m}) = thisMouse;
else
control.(mouseNames{m}) = thisMouse;
end
end
end
>>>>>>> upstream/master