Random Element
Version 1.0.0.0 (1,4 KB) von
Skynet
Returns elements randomly selected from any matrix.
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'}
Zitieren als
Skynet (2024). Random Element (https://www.mathworks.com/matlabcentral/fileexchange/6644-random-element), MATLAB Central File Exchange. Abgerufen .
Kompatibilität der MATLAB-Version
Erstellt mit
R14SP1
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxKategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.0.0.0 | Made minor update to description and comments. |