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!