Random Element

Versión 1.0.0.0 (1,4 KB) por Skynet
Returns elements randomly selected from any matrix.
2,3K descargas
Actualizado 25 abr 2005

Ver licencia

RANDELEMENT(ARRAY,N) returns a row of N elements, selected at random (and with replacement) from ARRAY.

[There probably is some toolbox function that does something very similar.]

EXAMPLES:

randelement([0:9],5)
may return [4 8 8 5 2]

randelement({'a' 'b' 'c' 'd' 'e' 'f'},2)
may return {'f' 'd'}

Citar como

Skynet (2024). Random Element (https://www.mathworks.com/matlabcentral/fileexchange/6644-random-element), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R14SP1
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y MATLAB Answers.

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0

Made minor update to description and comments.