choosing K elements out of N elements
Ältere Kommentare anzeigen
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 Kommentare
John D'Errico
am 20 Mär. 2016
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
am 21 Mär. 2016
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Conway's Game of Life finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!