科迪
So a selection of [3 2 9], [9 2 3] are both considered to be [2 3 9].
There are 286 unique selections possible. These can be ordered in lexicographic order:
Element 1 = [ 1 2 3] Element 2 = [ 1 2 4] Element 3 = [ 1 2 5] Element 4 = [ 1 2 6] Element 5 = [ 1 2 7] Element 6 = [ 1 2 8] Element 7 = [ 1 2 9] Element 8 = [ 1 2 10] Element 9 = [ 1 2 11] Element 10 = [ 1 2 12] Element 11 = [ 1 2 13] Element 12 = [ 1 3 4] Element 13 = [ 1 3 5] Element 14 = [ 1 3 6] Element 15 = [ 1 3 7] ... Element 285 = [10 12 13] Element 286 = [11 12 13]
Given the three ordered values as a row vector, return the element number.
Do this with an eye for speed, though it is not tested for here.
Looking for a way to do this WITHOUT generating the nchoosek matrix.
模式匹配
2016 Solvers
Twins in a Window
134 Solvers
Back to basics 14 - Keywords
415 Solvers
创建具有特定行和列总和的逻辑矩阵
220 Solvers
找出总和并携带二进制加法器
751个求解器
扑克系列03:Isfullhouse
65 Solvers
Poker Series 10: bestHand
41个求解器
退休储蓄
25个求解器
选择最佳合身多米诺骨牌
217求解器
Getting logical indexes
898求解器
Find the treasures in MATLAB Central and discover how the community can help you!
选择一个网站
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
您还可以从以下列表中选择一个网站:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
联系您当地的办公室