choosing K elements out of N elements
古いコメントを表示
Hi,
Is there any function which acts as the following: given a set of n elements, it returns all the k-chosen combinations such that these k elements have at a distance of at most P? For example out of 1:100 we want to chose 5 elements such that they have a maximum distance of 10. how can we do it? btw I need a fast function
Thanks a lot
2 件のコメント
John D'Errico
2016 年 3 月 20 日
Do you seriously expect that such a code already exists?
First, define what you mean by the word distance. I can think of at least 2 meanings.
As for being fast, everybody wants fast code. I have never actually seen someone say that they explicitly want slow code, or that they don't really care if the code is fast or incredibly slow.
Sepehr Janghorbani
2016 年 3 月 21 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Conway's Game of Life についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!