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!