Divide a Large Matrix into Smaller Matrices in a Loop
Afficher commentaires plus anciens
Hi all,
I have a Matrix of dimensions 20x5.
I need to run calculations, using For loops, on a program that first needs the first 4 lines of the large matrix, then the next 4 lines etc...
In other terms: 1 iteration ---> Large matrix lines [1 to 4 x 5] .... used for the calculations. Then 2 iteration ---> Large matrix lines [5 to 8 x 5] .... used for 2nd iteration calculations. Then 3 iteration ---> Large matrix lines [9 to 12 x 5].... used for 3rd iteration calculations etc...
Does anyone has an idea on how to make it happen?
Réponse acceptée
Plus de réponses (1)
Andrei Bobrov
le 21 Nov 2017
Modifié(e) : Andrei Bobrov
le 21 Nov 2017
mat1 - matrix with size (20,5)
row1 = 4;
Matrix1 = permute(reshape(mat1.',size(mat1,2),row1,[]),[2,1,3]);
Catégories
En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!