how to find possible combinations
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Postit123
el 6 de Nov. de 2020
Comentada: Postit123
el 6 de Nov. de 2020
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 comentario
Respuesta aceptada
Bruno Luong
el 6 de Nov. de 2020
Editada: Bruno Luong
el 6 de Nov. de 2020
% 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]);
Más respuestas (0)
Ver también
Categorías
Más información sobre Deep Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!