Enumerate outcomes of Sampling without order, but with replacement
Given a set
S = {1,2,...,n},
nreplace(n,k) returns a matrix, each row of which represents a possible outcome of selecting k elements from S, while one element can be selected multiple times. See e.g. the Example at the bottom of http://en.wikibooks.org/wiki/Probability/Combinatorics#Partitions.
The implementation is recursive, using a nested function, so it will only run on Matlab Version 7 and upwards.
引用格式
Jonathan Epperl (2024). Enumerate outcomes of Sampling without order, but with replacement (https://www.mathworks.com/matlabcentral/fileexchange/35378-enumerate-outcomes-of-sampling-without-order-but-with-replacement), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
- MATLAB > Mathematics > Elementary Math >
- MATLAB > Language Fundamentals > Matrices and Arrays > Resizing and Reshaping Matrices >
- MATLAB > Mathematics > Elementary Math > Discrete Math >
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0.0 |