How can I make a variant submatrix?
Mostrar comentarios más antiguos
Hello everybody,
Does anyone know how I can make a variant submatrix, for example, if I have a matrix A (100,100) use a submatrix B (10,10) to get the first 10 rows and 10 columns, then the next 10 columns so on until all elements of the columns and rows have been taken.
Respuesta aceptada
Más respuestas (1)
Asad (Mehrzad) Khoddam
el 22 de Oct. de 2020
You can use vectors to point to the indices of matrix A,
For example:
A(1:10, 1:10); % the first one
A(11:20, 1:10) % second submatrix
A(21:30, 1:10)
%...
A(91:100, 1:10);
A(1:10, 11:20 ...
% ...
A(91:100, 91:100);
% you need to have a loop to go through all sub matrices
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!