-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbugSaveTrialData.m
29 lines (28 loc) · 1.1 KB
/
bugSaveTrialData.m
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
classdef bugSaveTrialData < bug
methods
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function go(WL)
delete('save.mat');
WL.run('save_file', 'save', 'config_file', 'cfgSaveTrialData')
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function exitreport(WL)
fnames = fieldnames(WL.cfg.tosave);
disp('WL.Trial:');
disp(rmfield(WL.Trial, setdiff(fieldnames(WL.Trial), fnames)));
disp('WL.cfg.TrialData_Single:');
disp(WL.cfg.TrialData_Single(:, fnames));
disp('WL.TrialData:');
disp(WL.TrialData(:, fnames))
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function addToTrial(WL)
varnames = fieldnames(WL.cfg.tosave);
for i=1:numel(varnames)
name = varnames{i};
WL.Trial.(name) = WL.cfg.tosave.(name){WL.TrialNumber};
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
end