Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 189 x 4914 矩阵,并试图找到每个 1x26 子矩阵中每一行的总和。我该怎么办?
非常感谢。
尝试这个:
n = 26; result = reshape(sum(reshape(x.', n, []), 1), [], size(x, 1)).';
您可以查看中间结果以了解其工作原理:reshape(x.', n, []),然后sum(reshape(x.', n, []), 1)等
reshape(x.', n, [])
sum(reshape(x.', n, []), 1)