How to select all subset of rows of a matrix given the size of subset
6 views (last 30 days)
Show older comments
Hi, i want to select all possible submatrices of rows -subsets of a matrix given the size of subset. i.e if i have the matrix X=[1 2 3;4 5 6; 7 8 9] i want to give k=2 (for example) and get
x1=[1 2 3;4 5 6] x2=[1 2 3;7 8 9] x3=[4 5 6;7 8 9].
This is an example. Is there a built-in or something for this?
0 Comments
Answers (1)
Matt J
on 2 Dec 2012
Use NCHOOSEK
See Also
Categories
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!