-
Notifications
You must be signed in to change notification settings - Fork 0
/
createOutput.m
33 lines (27 loc) · 1004 Bytes
/
createOutput.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
30
31
32
33
subjects = {'01' '02' '03' '04' '05' '06' '07' '08' ...
'09' '10' '11' '12' '13' '14' '15'};
sessions = { '04' '05' '06' '07'};
%sessions = { '01' '02' '03'};
targpreds = [];
targpreds_ens = [];
for sb = subjects
for ss = sessions
subj = sb{1};
session = ss{1};
make_mult_prediction;
%targpreds = [targpreds; mdmTargPred'];
targpreds_ens = [targpreds_ens; ensTargPred2'];
end
end
%% Saving CSV output file in a proper format
to_save = targpreds_ens;
nrBlocks = size(to_save,2);
subj_column = reshape(repmat(1:length(subjects),[length(sessions),1]), [length(subjects)*length(sessions),1]);
sess_column = reshape(repmat(1:length(sessions),[length(subjects),1])', [length(subjects)*length(sessions),1]);
to_save = [subj_column sess_column to_save];
colNames = {'SUBJECT', 'SESSION'};
for i=1:nrBlocks
colNames{i+2} = ['a', num2str(i)];
end
T = array2table(to_save,'VariableNames',colNames);
writetable(T,'out_ens7.csv','Delimiter',',');