vendredi 12 février 2021

Matlab: How to randomize trials without presenting the same trial consecutively

I'm a very beginner of Matlab and I'm struggling in randomizing trials in my task on Psychtoolbox, in Matlab. Here is the code I have:

TrialIndex(NumOfPracticeTrials+1:maxTrial)=NumOfPracticeTrials+randperm((maxTrial-NumOfPracticeTrials);

This code works, so that I present the practice trials in a fixed order, while the testing trials are randomized. However, I don't want the same trial to be presented consecutively. I think this is a very naive question but I can't fix it.

Can I ask your help? Thank you very very much!! :)




Aucun commentaire:

Enregistrer un commentaire