MATLAB: Dear all:I have a 6* 3 matrix. I wanna choose 4rows randomly. how can I selecete all array in a rows randomly without replacement matlab guid for example: A=[1 2 3;2 3 5;6 4 1;8 6 0;2 4 1;1 4 7;8 4 2]; and the answer is: [1 2 3;6 4 1;8 6 0;8 4 2]; Best Answer A=[1 2 3;2 3 5;6 4 1;8 6 0;2 4 1;1 4 7;8 4 2]B=A(randperm(6,4),:) Related SolutionsMATLAB: Call all element inside cell (this cell contain another set of cells) [cell_A{:}] MATLAB: Matrix m=[1 2 3;1 1 1;4 5 8;4 5 8;1 1 1;1 1 1;1 1 1;1 1 1;1 1 1;1 1 1;1 1 1;1 1 1;4 5 8;7 8 5; 47 9 5;7 8 5;5 322 5;7 8 55];variant 1[a b n] = unique(m,'rows','first');[id id] = sort(b);out1 = a(id,:);variant 2[a b n] = unique(m,'rows','first');[id id] = sort(b);t = accumarray(n,ones(numel(n),1)) == 1;a2 = a(id,:);out2 = a2(t(id),:); Related QuestionHow to transpose a block matrixHow to convert 2X4X10 array into 4x2x10 arrayHow to append values in a vector in for loopDelete Rows that have a negative number in their first column.Determine the loop which satisfies the particular condition.
Best Answer