how to break up a huge matrix at a specific different rows breakpoints into several smaller matrices
1查看(最近30天)
Show older comments
我有一个巨大的矩阵,我需要排序和分解成较小的矩阵,现在给出了我们知道我们应该拆分矩阵的行的indcies,我们可以在另一个矩阵中存储某个矩阵的奇迹如何打破矩阵在那些特定的断点中有效地进入几个较小的矩阵?
Accepted Answer
Walter Roberson
于2021年9月13日
在索引指示新块的开始情况的情况下:
TheMatrix = randi(9, 15, 2)
split_indices = sort(1 + randperm(14,2))%beginnings of blocks
blk = diff([1 reshape(split_indices, 1, []) size(TheMatrix,1)+1]);
Splits = Mat2cell(Thematrix,Blk,大小(Thematrix,2))
celldisp(splits)
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
开始狩猎!