The following Matlab project contains the source code and Matlab examples used for return a random subset of k elements of the set of n elements .
A = RANDSUBSET(N, K) is equivalent to
ALLSUBSETS = NCHOOSEK(1:N,K);
A = ALLSUBSETS(RANDI(NCHOOSEK(N,K)));
% or
A = RANDPERM(N);
A = SORT(A(1:k));
This function can also be used to generate random sampling without replacement by calling RANDPERM on the output.

The source code and files included in this project are listed in the project files section, please make sure whether the listed source code meet your needs there.

## Project Files:

File Name | Size |
---|---|

license.txt | 1311 |

randsubset.m | 984 |

randsubset_install.m | 441 |

randsubset_matlab.m | 1187 |

rssfloyd.c | 2276 |

rssfloyd.m | 423 |