randomly select elements of an array without repeat and create a matrix with these elements as rows
Show older comments
Hi All,
I have integers from 1 to n. I want to choose m integers without replacement. I want to repeat this process p times and create a matrix of size m x p. For each repetition, I am starting with the initial integers (from 1 to n).
I know that choosing the elements can be done using
randperm
but can this matrix be created without using a for loop?
1 Comment
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!