Random numbers without repetition
Mostra commenti meno recenti
Risposta accettata
Più risposte (1)
Titus Edelhofer
il 31 Mar 2011
Hi Joey, not really elegant, but could work (as long as your "real" need is not much larger):
Y = zeros(3, 10);
for i=1:3
Y(i,:) = randperm(10);
end
Y = Y(:, 1:3);
Titus
Categorie
Scopri di più su Programming in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!