Hi, I have a matrix.
I =
1 0 0 2 5 0 0 0 3 0 0 0
I know the position of 5 in I is 6 linear index.
is there any easy function to have the 8 other neighbors of 5. Thanks
neighbor
1 0 0 2 5 0 0 0 3 0 0 0
Best Answer