Assign random selection and removal of rows from 2d matrix

I have a 35x2 matrix containing incentives for a word memory experiment. Each time I run my program, I need to randomly select 16 cells so that the experiment is always different. I managed to do this with datasample () to create an 8x2 matrix, however I need to remove them from 35x2 to ensure that they will not be re-selected in the second of two tests. I know how to delete cells when cell coordinates are known; but not when they are randomly selected each time. Any advice would be greatly appreciated.

thanks

Kelly

+4
source share
1 answer

Datasample returns the indexes that it selects. Consider this

  m = rand(35,2); % // test matrix [si ] = datasample(m,8,1); % // s are the samples, i are their indices m(i,:) = []; % // elimination of selected samples 
+1
source

All Articles