Compute average of each value in a matrix without using for
1 次查看(过去 30 天)
显示 更早的评论
Hi all,
I was wondering is it possible to alter each value of a matrix based on the average value of its neighbors, wihtout using for loops?
Thanks in advance.
2 个评论
the cyclist
2012-10-31
It would eliminate a lot of guesswork on the part of people trying to help you if you could be much more specific about what you want to do, and ideally provide at least one example of the input and output you would expect from this.
采纳的回答
Honglei Chen
2012-10-31
you can use conv2 or imfilter, for example
x = magic(3)
y = conv2(ones(3)/9,x)
5 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!