

fid=fopen('No1_rav.txt','r');
[list,count]=fscanf(fid,'%d',[9,72]);
fclose(fid);

sess1_rt=list(6,1:24);
sess2_rt=list(6,25:48);
sess3_rt=list(6,49:72);

sess1_type=list(5,1:24);
sess2_type=list(5,25:48);
sess3_type=list(5,49:72);

%define the possible onset times (taking into account the fixation scan)

for i=1:23
onset_times(1) = 2;
onset_times(i+1)=onset_times(i)+15;
end

% SOA order for session1 (SOA[sess#]_[type=#rel])

soa1_0 = onset_times(find(sess1_type == 1));
soa1_1 = onset_times(find(sess1_type == 2));
soa1_2 = onset_times(find(sess1_type == 3));

% SOA order for session2

soa2_0 = onset_times(find(sess2_type == 1));
soa2_1 = onset_times(find(sess2_type == 2));
soa2_2 = onset_times(find(sess2_type == 3));

% SOA order for session3

soa3_0 = onset_times(find(sess3_type == 1));
soa3_1 = onset_times(find(sess3_type == 2));
soa3_2 = onset_times(find(sess3_type == 3));


% RT (problem solving) duration 

for i=1:24
sess1_rt(i)=round(sess1_rt(i)/2000);
sess2_rt(i)=round(sess2_rt(i)/2000);
sess3_rt(i)=round(sess3_rt(i)/2000);
end

% (RT[sess#]_[type=#rel])

rt1_0 = sess1_rt(find(sess1_type == 1));
rt1_1 = sess1_rt(find(sess1_type == 2));
rt1_2 = sess1_rt(find(sess1_type == 3));

rt2_0 = sess2_rt(find(sess2_type == 1));
rt2_1 = sess2_rt(find(sess2_type == 2));
rt2_2 = sess2_rt(find(sess2_type == 3));

rt3_0 = sess3_rt(find(sess3_type == 1));
rt3_1 = sess3_rt(find(sess3_type == 2));
rt3_2 = sess3_rt(find(sess3_type == 3));


save design soa1_0 soa1_1 soa1_2 soa2_0 soa2_1 soa2_2 soa3_0 soa3_1 soa3_2 rt1_0 rt1_1 rt1_2 rt2_0 rt2_1 rt2_2 rt3_0 rt3_1 rt3_2




