how to reduce the size of a matrix?
조회 수: 7 (최근 30일)
이전 댓글 표시
Suppose I have 4 by 4 matrix or of any size and I want to make it a 2by2 matrix by taking the average of the sub matrixes.
댓글 수: 0
채택된 답변
Image Analyst
2022년 6월 12일
m = randi(9, 4, 4) % Sample data.
sums = conv2(m, ones(2,2)/4, 'same');
means = sums(1:2:end, 1:2:end)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!