MATLAB: How to randomly select an element in a matrix arrayrandom Hi, I have a matrix for example A = [1,2,3,4,5,6]; I would like to randomly select an element in A. How do I do that? Best Answer A(randi(numel(A))) Related SolutionsMATLAB: Randomly select an element use randsamplehttps://www.mathworks.com/help/stats/randsample.html randsample(A,1) MATLAB: How to pick randomly elements from a vector without repetation a(randperm(length(a),2)) Related QuestionRepeat 3-D array elements
Best Answer