MATLAB: Is it possible to obtain a random sample of values from a matrix without the randsample tool MATLABrandom sample Is it possible to obtain a random sample of values from a matrix without the randsample tool? Best Answer A=magic(6);out=A(randi(numel(A),1))if you want 3 values for example out=A(randi(numel(A),3,1)) Related SolutionsMATLAB: How can i use randperm without involving some certain numbers Use randperm to compute a random permutation of indices into your value instead of a random permutation of your values:values = [1 3 4 5]randidx = randperm(numel(values));randvalues = values(randidx)%or as one line:randvalues = values(randperm(numel(values))) MATLAB: Incorrect sampling with weighted randsample Can you please explain the evidence that makes you say that "the random sampling seems to be incorrect"?When I run the commandsfigurehist(sample1,values)figurehist(sample2,values)the results look as I would expect. Related QuestionGenerating random values from another matrix with a random value in rows onlyProblem with using randsampleHow to sample a random value from a matrixSamplingGenerate real random numbersRandsample in matlab 2007How Matlab calculate randsample using randsample function
Best Answer