How to find all possible 8x8 submatrices of a 13x8 matrix?

2 visualizaciones (últimos 30 días)
HN
HN el 4 de Ag. de 2022
Editada: Matt J el 4 de Ag. de 2022
I have martrix A with size 13x8, and I want to find a list of all the possible 8x8 submatrices combinations of matrix A.
The number of submatrices possible is 13C8 = 1287
Any help is appreciated!

Respuesta aceptada

Torsten
Torsten el 4 de Ag. de 2022
r = nchoosek(1:13,8);
A = rand(13,8);
for i = 1:size(r,1)
B(:,:,i) = A(r(i,:),:);
end
size(B)
ans = 1×3
8 8 1287

Más respuestas (1)

Matt J
Matt J el 4 de Ag. de 2022
Editada: Matt J el 4 de Ag. de 2022
Using this File Exchange tool set,
A=rand(13,8);
submatrices = blkReshape( A(nchoosek(1:13,8)', : ) ,[8,8],1,1,[]);
whos submatrices
Name Size Bytes Class Attributes
submatrices 8x8x1287 658944 double
  3 comentarios
Matt J
Matt J el 4 de Ag. de 2022
Make sure you have my latest version.
HN
HN el 4 de Ag. de 2022
Sure, will check. Thank you!

Iniciar sesión para comentar.

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by