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에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!