Divide a Large Matrix into Smaller Matrices in a Loop
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
Andrei Bobrov
2017년 11월 21일
편집: Andrei Bobrov
2017년 11월 21일
mat1 - matrix with size (20,5)
row1 = 4;
Matrix1 = permute(reshape(mat1.',size(mat1,2),row1,[]),[2,1,3]);
카테고리
도움말 센터 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!