rand_unique_pairs(N​, pair_num, ordered, self_pair)

Version 1.2.0.0 (1,64 ko) par Yifan Gu
This function randomly generates unique integer number pairs, either ordered or unordered.
48 téléchargements
Mise à jour 13 mars 2017

Afficher la licence

This function could be handy for sampling pair-wise correlation from a large number of variables.
Input arguments:
N: defines the range of the numbers (from 1 to N)
pair_num: the number of pairs
ordered: 1 for ordered pairs and 0 for unordered. The default is 0.
self_pair: 1 for allowing self-pair (e.g, 3-3 is a self-pair). The default is 0.

Output argument:
pairs: a 2-by-pair_num matrix with each row containing a unique pair

Citation pour cette source

Yifan Gu (2024). rand_unique_pairs(N, pair_num, ordered, self_pair) (https://www.mathworks.com/matlabcentral/fileexchange/61456-rand_unique_pairs-n-pair_num-ordered-self_pair), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2006a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.2.0.0

Fix some errors

1.1.0.0

Update the description.

1.0.0.0