How do I make an average of points ?
Show older comments
Hi, say I have an 11*10 matrix and for every point in the 6th row, I want matlab to take an average of the surrounding points and make a new row; ie 1 point has 8 surrounding points then the same for each point in the row, how would this be done please ? Thanks
2 Comments
jonas
on 22 Aug 2018
Please provide an example with input and desired output
Ernest Adisi
on 22 Aug 2018
Accepted Answer
More Answers (1)
Yuvaraj Venkataswamy
on 22 Aug 2018
Edited: Yuvaraj Venkataswamy
on 22 Aug 2018
Check this,
if true
X = rand(11,10);
k = 6;
MA = movmean(X,[(k-1) 0]);
Y = MA(k:k:end,:);
end
Categories
Find more on Creating and Concatenating Matrices 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!