What I'm trying to do is to find the sum of the surrounding elements of an binary array
For example
[1 0 0 1; 1 0 1 0; 0 0 1 1; 1 0 0 0]
would return
[1 3 2 1; 1 4 3 3; 2 4 2 2; 0 2 2 2]
but is there a way to do so without using conv2? as I dont really understand what conv2 does
Best Answer