Finding connection between elements of an array

Hi,
I have an array,
A = [1 3 5 7 2 4 9 3;
2 2 7 5 3 8 10 2];
I want to know the number of connection between elements considering both rows.
For example, 2 is connected with 1 and 3 if I consider row-wise relation. So, number of connection for 2 is = 2. And, similarly, number of connection for 7 is = 1.
How can I know that number for all elements.
Thanks in advance.

댓글 수: 4

If 2 is connected to 1 and 3 above it, then why is 7 in the bottom row not connected to 3 and 5 above it? And what's the definition of "row-wise relation"?
Majbah
Majbah 2014년 11월 20일
The array is formulated as random. I want to know the connection only, whether in bottom or top row.
By 'row-wise relation' I meant, I will only consider the connection between row elements. For example, 8 is connected with 4 only, not 10 or 3.
Can we assume they're all integers, or do we have to worry about floating point numbers?
Majbah
Majbah 2014년 11월 21일
Yes, all numbers are integer.

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2014년 11월 21일
편집: Image Analyst 2014년 11월 21일

0 개 추천

If they're integers and you have the Image Processing Toolbox, you can compute the Gray Level Co-occurrence Matrix (GLCM), which is what you're asking for (though you don't know it yet). Use the graycomatrix() function.

추가 답변 (0개)

태그

질문:

2014년 11월 20일

댓글:

2014년 11월 21일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by