randomly select elements of an array without repeat and create a matrix with these elements as rows
Afficher commentaires plus anciens
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 commentaire
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!