Using reshape to manipulate a large matrix
이전 댓글 표시
I have a 10000x10000 matrix of data that I'm trying to scale down. You goal is to make it a 400x400 matrix by taking every cell in 25x25 cell chunk and averaging them into one value. I'm trying to use the reshape function to do this, but I dont know how to scale down the matrix by any factor other than 2, the code for that is below. Any advice on hw I can do to adapt or rewrite this is appreciated.
[x,y] = size(matrix);
x1 = x/2;
y1 = y/2;
R = reshape(reSizedData,2 , x1, 2, y1);
S = sum(sum(R, 1), 3) * 0.5;
Y = reshape(S, x1, y1);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!