How to take the mean of each four adjacent position in a matrix?
1 view (last 30 days)
Show older comments
Ali Almakhmari on 12 Jun 2022
Answered: Chuguang Pan on 12 Jun 2022
So I have this matrix variable that I attached here. Its 1536 by 2048, and I want to reduce it to 768 by 1024 by taking the mean of each four adjacent positions with the omitnan opition as well so I can take out the useless NaNs there. I hope someone can help. Thanks
Chuguang Pan on 12 Jun 2022
A=randi(10,1536,2048); % test Matrix
M=zeros(768,1024); % result Matrix
More Answers (0)
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!