Shift a square matrix along a bigger square matrix by one
5 views (last 30 days)
Bjorn Gustavsson on 30 Nov 2022
Have a look at the help and documentation for the function circshift. That function should solve the problem you have described.
DGM on 30 Nov 2022
Edited: DGM on 8 Dec 2022
If you're forced to do it manually, then there are many examples of sliding window filters on the forum.
You can use padarray for edge padding. See: