-
Notifications
You must be signed in to change notification settings - Fork 4
/
extract_behav.m
21 lines (20 loc) · 995 Bytes
/
extract_behav.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
%load('E:\Data\Session-20210608_SCR16_test2\SCR16_Dual2AFC_Jun08_2021_Session1');
%save_name = 'E:\Data\Session-20210608_SCR16_test2\behavmat';
function extract_behavior(behav_file, save_name, opto)
SessionData = load(behav_file);%.SessionData;
SessionData = SessionData.SessionData;
states = SessionData.RawData.OriginalStateData;
named_states = SessionData.RawData.OriginalStateNamesByNumber;
choice = SessionData.Custom.ChoiceLeft;
correct = SessionData.Custom.ChoiceCorrect;
rewarded = SessionData.Custom.Rewarded;
wait_time = SessionData.Custom.FeedbackTime;
DV = SessionData.Custom.DV;
catch_trials = SessionData.Custom.CatchTrial;
if opto
opto_trial = SessionData.Custom.LaserTrial;
save(save_name, 'choice', 'correct', 'DV', 'named_states', 'states', 'wait_time', 'catch_trials', 'opto_trial');
else
save(save_name, 'choice', 'correct', 'DV', 'named_states', 'states', 'wait_time', 'catch_trials');
end
end