How can I calculate summary of sub matrix in very large matrix ?
1 次查看(过去 30 天)
显示 更早的评论
I have very large matrix which can be 1000*1000,how to create fast algorithm which calculates summary of submatrix if I have upper left corner, width and height?
Thanks!
0 个评论
采纳的回答
Image Analyst
2018-7-17
By "summary", I assume you mean "sum". If so, just do
subMatrix = m(topRow:topRow+height-1, leftCol:leftCol+width-1);
theSum = sum(subMatrix(:))
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Denoising and Compression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!