how to reduce the size of a matrix?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
DARSHAN KUMAR BISWAS
le 12 Juin 2022
Réponse apportée : Image Analyst
le 12 Juin 2022
Suppose I have 4 by 4 matrix or of any size and I want to make it a 2by2 matrix by taking the average of the sub matrixes.
0 commentaires
Réponse acceptée
Image Analyst
le 12 Juin 2022
m = randi(9, 4, 4) % Sample data.
sums = conv2(m, ones(2,2)/4, 'same');
means = sums(1:2:end, 1:2:end)
0 commentaires
Voir également
Catégories
En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!