Random numbers without repetition
Mostrar comentarios más antiguos
Respuesta aceptada
Más respuestas (1)
Titus Edelhofer
el 31 de Mzo. de 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
Categorías
Más información sobre Random Number Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!