how to find possible combinations

2 ビュー (過去 30 日間)
Postit123
Postit123 2020 年 11 月 6 日
コメント済み: Postit123 2020 年 11 月 6 日
Hello
There's a 32X10 matrix dataset and I want to need all possible 4X10 data combinations.
Plus the data of each row remain same through the combination.
Do you have any idea for this?
Thanks you.
  1 件のコメント
KSSV
KSSV 2020 年 11 月 6 日
You mean you want 4X10X8 matrices of all combinations?

サインインしてコメントする。

採用された回答

Bruno Luong
Bruno Luong 2020 年 11 月 6 日
編集済み: Bruno Luong 2020 年 11 月 6 日
% Test data
A=rand(32,10);
[m,n]=size(A);
I=nchoosek(1:m,4).';
% Each slice B(:,:,k) is a 4x10 (without-replacement) combination
B=permute(reshape(A(I,:),4,[],n),[1 3 2]);
  1 件のコメント
Postit123
Postit123 2020 年 11 月 6 日
Thank you so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by