Effacer les filtres
Effacer les filtres

Finding connection between elements of an array

1 vue (au cours des 30 derniers jours)
Majbah
Majbah le 20 Nov 2014
Commenté : Majbah le 21 Nov 2014
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 commentaires
Image Analyst
Image Analyst le 21 Nov 2014
Can we assume they're all integers, or do we have to worry about floating point numbers?
Majbah
Majbah le 21 Nov 2014
Yes, all numbers are integer.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 21 Nov 2014
Modifié(e) : Image Analyst le 21 Nov 2014
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.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by