0

How can I tell matlab to use numbers again ?

I have 10 Trials but only 8 numbers and I want to tell matlab to repeat the numbers in a randomized order. How can I do this?

numbers = {0 1 2 3 4 5 6 7 8};

Carina
  • 3
  • 2

1 Answers1

1

The Psychtoolbox function RandSel can be used for this:

numbers = 1:8;
trialNumbers = RandSel(numbers, 10);

Note that because the selection is random, on a given run of 10 trials a given number might be repeated several times or not used at all.

DMR
  • 1,479
  • 1
  • 8
  • 11