-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShuffle.m
More file actions
97 lines (68 loc) · 2.89 KB
/
Shuffle.m
File metadata and controls
97 lines (68 loc) · 2.89 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
%% CREATE GRATING SEQUENCES
% Define proportions
N_type = 50; % 70%
% create list of N_look * 8 and N_task * 8
gratingselection = [
zeros(N_type + 50,1) + 1; % + 25 because need double amount of horizontal gratings
zeros(N_type,1) + 2;
zeros(N_type,1) + 3;
zeros(N_type,1) + 4;
zeros(N_type + 50,1) + 5; % + 25 because need double amount of horizontal gratings
zeros(N_type,1) + 6;
zeros(N_type,1) + 7;
zeros(N_type,1) + 8];
% Shuffle the initial list and save it
rng(10) % 'set seed' so randperm always shuffles in the same way
gratingSelection_shuffled = gratingselection(randperm(length(gratingselection)));
gratingSeq = transpose(gratingSelection_shuffled);
% create four lists out of the one
gratingSequence1 = gratingSeq(:,1:125);
gratingSequence2 = gratingSeq(:,126:250);
gratingSequence3 = gratingSeq(:,251:375);
gratingSequence4 = gratingSeq(:,376:500);
%% CREATE CROSS SEQUENCES
% Define proportions
N_look = 100; % 80%
N_cross = 25; % 20%
% create list of N_look * 8 and N_task * 8
crossSelection = [
zeros(N_look,1);
zeros(N_cross,1) + 1;];
% Shuffle the initial list and save it
rng(10) % 'set seed' so randperm always shuffles in the same way
crossSequence1 = transpose(crossSelection(randperm(length(crossSelection))));
rng(11) % 'set seed' so randperm always shuffles in the same way
crossSequence2 = transpose(crossSelection(randperm(length(crossSelection))));
rng(12) % 'set seed' so randperm always shuffles in the same way
crossSequence3 = transpose(crossSelection(randperm(length(crossSelection))));
rng(13) % 'set seed' so randperm always shuffles in the same way
crossSequence4 = transpose(crossSelection(randperm(length(crossSelection))));
%% Create Training Sequences
% Define proportions
N_type = 1; % 70%
% create list of N_look * 8 and N_task * 8
gratingselection = [
zeros(N_type,1) + 1; % + 25 because need double amount of horizontal gratings
zeros(N_type,1) + 2;
zeros(N_type,1) + 3;
zeros(N_type,1) + 4;
zeros(N_type,1) + 5; % + 25 because need double amount of horizontal gratings
zeros(N_type,1) + 6;
zeros(N_type,1) + 7;
zeros(N_type,1) + 8];
% Shuffle the initial list and save it
rng(10) % 'set seed' so randperm always shuffles in the same way
gratingSelection_shuffled = gratingselection(randperm(length(gratingselection)));
gratingSeqTraining = transpose(gratingSelection_shuffled);
gratingSequence0 = gratingSeqTraining;
% Define proportions
N_look = 7; % 80%
N_cross = 1; % 20%
% create list of N_look * 8 and N_task * 8
crossSelection = [
zeros(N_look,1);
zeros(N_cross,1) + 1;];
% Shuffle the initial list and save it
rng(10) % 'set seed' so randperm always shuffles in the same way
crossSequenceTraining = transpose(crossSelection(randperm(length(crossSelection))));
crossSequence0 = crossSequenceTraining;