pickn

版本 1.0.0.0 (956 字节) 作者: Richard Medlock
Return P random picks of N items from an input vector A.
2.2K 次下载
更新时间 2003/5/19

无许可证

B = PICKN(A,N,P)

Returns P random Picks of N items from vector A.

PickN assumes that each item can be repelaced after selection.

Example:
A list contains four elements: [1 2 3 4]
Show two possible combinations of choosing 3 items
from the list.

A = [1:4];
N = 3;
P = 2;

B = pickn(A,N,P)

1 3 1
2 4 1

If you specifcy P as the string 'all', then B will contain
all possible permutations.

引用格式

Richard Medlock (2024). pickn (https://www.mathworks.com/matlabcentral/fileexchange/3423-pickn), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Graph and Network Algorithms 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Typo. 3rd arg was supposed to be P not C. If you have already downloaded the previous version, please change it to P, otherwise there is now a new version available.