How to find the neighbors of each element in a matrix
Hi,
how I can find the neighbors of each element in a given matrix? Does such a method exist in Matlab?
Here is an example :
A=[3 4 8 6;
1 6 9 0;
2 5 7 1]
The neighbors of A(1,1) are {1, 4, 6}; The neighbors of A(1,2) are {3, 1, 6, 8, 9}; The neighbors of A(2, 1) are {3, 2, 4, 6, 5}; The neighbors of A(2, 2) are {3, 1, 2, 4, 5, 8, 9, 7}
Thanks.Hi,
how I can find the neighbors of each element in a given matrix? Does such a method exist in Matlab?
Here is an example :
A=[3 4 8 6;
1 6 9 0;
2 5 7 1]
The neighbors of A(1,1) are {1, 4, 6}; The neighbors of A(1,2) are {3, 1, 6, 8, 9}; The neighbors of A(2, 1) are {3, 2, 4, 6, 5}; The neighbors of A(2, 2) are {3, 1, 2, 4, 5, 8, 9, 7}
Thanks. Hi,
how I can find the neighbors of each element in a given matrix? Does such a method exist in Matlab?
Here is an example :
A=[3 4 8 6;
1 6 9 0;
2 5 7 1]
The neighbors of A(1,1) are {1, 4, 6}; The neighbors of A(1,2) are {3, 1, 6, 8, 9}; The neighbors of A(2, 1) are {3, 2, 4, 6, 5}; The neighbors of A(2, 2) are {3, 1, 2, 4, 5, 8, 9, 7}
Thanks. neighbors of each element in a matrix MATLAB Answers — New Questions