MATLAB: How i will choose a random element of a matrix matrixrandom I have a matrix A,and i want to choose randomly an element from the matrix.How i will do that? Best Answer One way A = rand(3,4) A( randi([1,size(A,1)],1), randi([1,size(A,2)],1) ) Related SolutionsMATLAB: Random numbers help randdoc rand MATLAB: How to generate dibits using uniform number generator N = 20;dibits = complex(randi([0,1], N, 1), randi([0,1], N, 1)) Related QuestionTo choose and shift an element randomlyRepeat 3-D array elementsChoose two coordinates
Best Answer