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!