【发布时间】:2014-05-19 15:07:57
【问题描述】:
我有一个矩阵
My_big_matrix_=rand(21,4)
My_big_matrix_=[
1.0000 0.8147 0.0357 0.7655
2.0000 0.9058 0.8491 0.7952
3.0000 0.1270 0.9340 0.1869
4.0000 0.9134 0.6787 0.4898
5.0000 0.6324 0.7577 0.4456
6.0000 0.0975 0.7431 0.6463
7.0000 0.2785 0.3922 0.7094
8.0000 0.5469 0.6555 0.7547
9.0000 0.9575 0.1712 0.2760
10.0000 0.9649 0.7060 0.6797
11.0000 0.1576 0.0318 0.6551
12.0000 0.9706 0.2769 0.1626
13.0000 0.9572 0.0462 0.1190
14.0000 0.4854 0.0971 0.4984
15.0000 0.8003 0.8235 0.9597
16.0000 0.1419 0.6948 0.3404
17.0000 0.4218 0.3171 0.5853
18.0000 0.9157 0.9502 0.2238
19.0000 0.7922 0.0344 0.7513
20.0000 0.9595 0.4387 0.2551
21.0000 0.6557 0.3816 0.5060];
我想获得不同的行组合以获得大小为 (7*4) 的矩阵
这些组合应该是
Combination_(1,1)={1,4,7,10,13,16,19}
Combination_(1,2)={1,5,7,10,13,16,19}
Combination_(1,3)={1,6,7,10,13,16,19}
Combination_(1,4)={2,4,7,10,13,16,19}
Combination_(1,5)={2,5,7,10,13,16,19}
Combination_(1,6)={2,6,7,10,13,16,19}
Combination_(1,7)={3,4,7,10,13,16,19}
Combination_(1,8)={3,5,7,10,13,16,19}
Combination_(1,9)={3,6,7,10,13,16,19}
Combination_(1,10)={1,4,7,10,13,16,19}
Combination_(1,11)={1,5,8,10,13,16,19}
Combination_(1,12)={1,6,9,10,13,16,19}
编辑: 在我的组合中,三行 (1,2,3),(4,5,6),(7,8,9),...(19,20,21)... 是组。只会选一名成员,绝不会选两名成员。所以可能的解决方案不会太高。
My_small_matrix_ having size of (7,4)
有什么想法吗?
【问题讨论】:
-
是的,学习一些关于组合和排列的知识:mathsisfun.com/combinatorics/combinations-permutations.html
-
我建议您更改标题,以便更好地反映问题的内容。 “来自矩阵的用户定义解决方案”令人困惑
标签: matlab math matrix indexing combinations