Using reshape to manipulate a large matrix
Afficher commentaires plus anciens
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);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!