MATLAB: Random Selection of Each Element in Vector

vector

Greetings,
I have a vector of 12 elements (a = [10 20 35 38 40 45 48 50 55 58 60 75]') and I want to randomly select one element at a time. How can I do that? Thank you very much.

Best Answer

randA = a( randperm( numel(a) ) )
will give you them in a random order all at once. Then you can take them in turn if you wish.