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!