MATLAB: RSVP : REPLACE LETTERS WITH DIGITS

rsvprsvp - replace letters with digitsrsvp-experiment

% CONDITION 1 = RSVP OF 13-21 LETTERS RANDOMLY WITHOUT REPLACEMENT
% CONDITION 2 = 2 OF THE LETTERS WERE REPLACED WITH DIGITS, RANDOMLY DRAWN
% CONDITION 3 = T2 IS PRESENTED 3 TO 6 TEMPORAL POSITIONS FROM THE END
% CONDITION 4 = T1 AND T2 VARIED FROM 1:5 ITEMS
I am trying to run psychtoolbox for my RSVP experiment. can someone please help me to program (replace) letter stream with T2 and T1 as required in condition 3 and condition 4.
s = ['A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'J' 'K' 'L' 'M' 'N' 'P' 'R' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'];
str=datasample(s,1,'Replace', false);
nletters = [13:21];
ntrial = datasample(nletters,1);
T1 = randi([2,9], black);
T2 = randi([2,9], black);
l2 = datasample(nletter);
for index = 1:ntrial
str=datasample(s,1,'Replace', false)
T1 = strrep(s,
T2 = strrep(s,
end

Best Answer

s = 'A':'Z';
%condition 1
numletters = randi([13, 21]); %number of letters to select is a random number from 13 to 21 letters
rsvp = s(randperm(numel(s), radn)); %draw that number of letters randomly without replacements
%condition 2
digits = '0':'9';
replaceidx = randperm(numel(rsvp), 2); %select 2 different indices
replacement = digits(randi(numel(digits), 2)); %and two digits. If the two digits MUST be different use randperm instead of randi
rsvp(replaceidx) = replacement; %replace the letters at the two random indices by the random digits
As per my comment to your question, I have no idea what the other 2 conditions mean.