MATLAB: Selecting values randomly from dataset random I have a data of 100*60 ,i want to select 3 rows randomly please help Best Answer IDX = randperm(size(X,1));RandomRows = X(IDX(1:3),:); Related SolutionsMATLAB: How to select random rows from a matrix and delete it from the original matrix for another random selection. A=rand(100); % a random matrixn=10;. idx=randsample(1:size(A,1),n) ;B = A(idx,:) ; % pick rows randomly A(idx,:)=[]; % remove those rowsidx = randsample(1:size(A,1),n) ;C= A(idx,:); MATLAB: Edit-selecting random values EDIT [09:13(UTC+4) 13.01.2012]A = randi(48,10)s = size(A);n = [3 10];q = reshape(1:numel(A),s(1),[]);rc = s - n + 1;m = q(1:rc(1),1:rc(2));I = randperm(numel(m));p = m(I(1));out = A(rem(p-1,s(1))+(1:n(1)),ceil(p/s(1))+(0:n(2)-1)) Related QuestionHow to select a random number from set 5:20:2000How to select randomly 30 numbers from 108 and maintain uniqueness
Best Answer