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

1 次查看(过去 30 天)
Is it possible to obtain a random sample of values from a matrix without the randsample tool?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2012-11-24
编辑:Azzi Abdelmalek 2012-11-24
A=magic(6);
out=A(randi(numel(A),1))
if you want 3 values for example
out=A(randi(numel(A),3,1))

更多回答(0 个)

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by