File Exchange

image thumbnail

samplepick

version 1.1.0.0 (1.6 KB) by Mauro
pick a random sample out of an array

0 Downloads

Updated 11 Mar 2010

View License

To test al model, with real data it can be useful to pick a smaller sample out of a bigger dataset.

An other application could be to decide how small a random sample should be to see if the process is working property.

Cite As

Mauro (2020). samplepick (https://www.mathworks.com/matlabcentral/fileexchange/26889-samplepick), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Mauro

jep, and it's faster ;-) ...

The function randperm is practically ready-made for this application. To draw a subset, s, of size m from a dataset, d, of size n, one can simply do

perm = randperm(n);
s = d(perm(1:m));

Updates

1.1.0.0

works now with randperm

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux