Hi guys!
I'm programming a task but I ran into serious trouble. I want to show pictures with 4 corresponding names (it's a task for testing face-name memory).
The problem I have is the following: I have a dictionary with names and with one picture. I create a randomized sequence for my pictures. Now I want to display (via Psychtoolbox) the respective Name Cues for the image, but in randomized order. The problem is that I don't manage to show the randomized names; instead, they are shown in the order of the dictionary. How do I randomize them correctly??
To exemplify what I refer to I show you some Code snippet which hopefully help:
nameCues1 = {'Lisa','Anna', 'Sarah', 'Nina', 'resized_1.jpg' }; nameCues2 = {'Emma', 'Lena', 'Gabi', 'Steffi', 'resized_2.jpg' }
I have loaded them into a cell array:
nameCuesAll = {nameCues1,nameCues2, nameCues3}
I create a randomized sequence:
randSeq3 = nameCuesAll(randperm(size(nameCuesAll,2)));
%% Loop for Rating Phase % Reads facial stimuli for i = 1:numel(nameCuesAll)
pics3{i} = imread(randSeq3{i}{1,5}); ind{i}=randperm(numel(randSeq3{i})); <---- does not work
end
Then I prompt in on the Screen via the function of Psychtoolbox. I just show the DrawFormattedText function here:
for j = 1:4 %%here I leave out some unnecessary functions of Psychtoolbox
DrawFormattedText(window,ind{i}(j), 'center', 'center', white, [], [], [], [], [], rect);
end
Thank you very much!
PR