How can I compact a matrix to a define size?

조회 수: 1 (최근 30일)
Daniel Fonsêca
Daniel Fonsêca 2018년 9월 6일
댓글: Daniel Fonsêca 2018년 9월 6일
I'm trying to build a compact array. I have a array 8192x8192 and I want to make it for 1024 x 1024. See the code:
MC = zeros(8192/8);
for i= 1:8192/8
for j=1:8192/8
for m=1:8
for n = 1:8
MC(i,j) = MC(i,j) + M(i+m-1;j+n-1) % Size M = 8192X8192
end
end
end
end

채택된 답변

KSSV
KSSV 2018년 9월 6일
A = rand( 8192,8192) ;
B = imresize(A,[1024 1024]) ;
Read about imresize, interp2.
  댓글 수: 2
Daniel Fonsêca
Daniel Fonsêca 2018년 9월 6일
That array has informations. Wnen I use resize or imresize, when i plot M, the result isn't the expected.
Daniel Fonsêca
Daniel Fonsêca 2018년 9월 6일
Thanks by the answer. I had made the array wrong, so the result was wrong. When i fixed it, the imresize worked.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by