Filter löschen
Filter löschen

Is it possible to obtain a random sample of values from a matrix without the randsample tool?

1 Ansicht (letzte 30 Tage)
Is it possible to obtain a random sample of values from a matrix without the randsample tool?

Akzeptierte Antwort

Azzi Abdelmalek
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))

Weitere Antworten (0)

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by