Random numbers without repetition
Ältere Kommentare anzeigen
Akzeptierte Antwort
Weitere Antworten (1)
Titus Edelhofer
am 31 Mär. 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
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!