Is it possible to obtain a random sample of values from a matrix without the randsample tool?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Is it possible to obtain a random sample of values from a matrix without the randsample tool?
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 24 de Nov. de 2012
Editada: Azzi Abdelmalek
el 24 de Nov. de 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 comentario
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!