Is it possible to obtain a random sample of values from a matrix without the randsample tool?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Is it possible to obtain a random sample of values from a matrix without the randsample tool?
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 24 Nov. 2012
Bearbeitet: Azzi Abdelmalek
am 24 Nov. 2012
A=magic(6);
out=A(randi(numel(A),1))
if you want 3 values for example
out=A(randi(numel(A),3,1))
1 Kommentar
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!