how to break up a huge matrix at a specific different rows breakpoints into several smaller matrices

1查看(最近30天)
嘛
于2021年9月13日
Commented: 于2021年9月13日
我有一个巨大的矩阵,我需要排序和分解成较小的矩阵,现在给出了我们知道我们应该拆分矩阵的行的indcies,我们可以在另一个矩阵中存储某个矩阵的奇迹如何打破矩阵在那些特定的断点中有效地进入几个较小的矩阵?
4评论
嘛
于2021年9月13日
谢谢你回复。如果目标只是访问Sublatrix,我会尽力做到你的。但每个Submatrix代表一组可自由的时间间隔。作为组织数据和标记它们的问题,我们需要提取这些子馅饼并将其标记为以供将来使用,然后以某种方式存储它们以供将来使用。我希望你有一种有效的方法来做到这一点。

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson 于2021年9月13日
在索引指示新块的开始情况的情况下:
TheMatrix = randi(9, 15, 2)
TheMatrix = 15×2
1 4 6 5 3 8 9 4 4 2 8 6 9 5 7 2 5 6 4 5
split_indices = sort(1 + randperm(14,2))%beginnings of blocks
split_indices = 1×2
3 6.
blk = diff([1 reshape(split_indices, 1, []) size(TheMatrix,1)+1]);
Splits = Mat2cell(Thematrix,Blk,大小(Thematrix,2))
分裂=3×1 cell array
{2×2双} {3×2双} {10×2双}
celldisp(splits)
分裂{1} = 1 4 6 5分裂{2} = 3 8 9 4 4 2分裂{3} = 8 6 9 5 7 2 5 6 4 5 8 4 6 4 2 5 5 7 9 4
3 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

开始狩猎!