From f327c3888de1fa5fc89c398d27433d5a4708bc55 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 15 Feb 2018 17:28:37 +0000 Subject: [PATCH 1/3] Split mice depending on NMDA value --- splitData.m | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/splitData.m b/splitData.m index ccd8595..a43545f 100644 --- a/splitData.m +++ b/splitData.m @@ -1,6 +1,17 @@ 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 - -end - +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 + test.(names{i})=dataSet.(names{i}); + else + control.(names{i}) = dataSet.(names{i}); + end +end \ No newline at end of file From 6e324dd9e9fdf44def1007f255b6e9d359c0b992 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 15 Feb 2018 17:45:38 +0000 Subject: [PATCH 2/3] Switch control and test to be the right way round --- splitData.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/splitData.m b/splitData.m index a43545f..893c5a9 100644 --- a/splitData.m +++ b/splitData.m @@ -10,8 +10,8 @@ for i =1:numel(names) NMDA = dataSet.(names{i}).NMDA; if NMDA == 0 - test.(names{i})=dataSet.(names{i}); + control.(names{i})=dataSet.(names{i}); else - control.(names{i}) = dataSet.(names{i}); + test.(names{i}) = dataSet.(names{i}); end end \ No newline at end of file From 92bf9ab47121b4a2516dc33c2f9a747306a8b033 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 15 Feb 2018 17:53:48 +0000 Subject: [PATCH 3/3] add get parameters --- getParameters.m | 1 + 1 file changed, 1 insertion(+) diff --git a/getParameters.m b/getParameters.m index 86e32fa..d8267fb 100644 --- a/getParameters.m +++ b/getParameters.m @@ -3,5 +3,6 @@ %parameters for a given trial where each row is an individual animal and %each column is the chosen parameter on each trial + end