How to get Adjacent matrix?

6 views (last 30 days)
Mariam Sheha
Mariam Sheha on 4 Jul 2013
Commented: Gayathri Nayar on 22 May 2019
Hi every body;
I am trying to graph my binary 'labeled' image through (gplot) function, but to do such implementation i have to convert my binary matrix to adjacent matrix and get it's coordinates...
I don't know to make such operations?!
the function: gplot(A,Coordinates)
Can any one help me through that, Please
Thank you;

Answers (1)

Matt J
Matt J on 4 Jul 2013
Isn't your binary matrix (let's call it A) already an adjacency matrix? If so, you should be able to do as below. If not, what does A represent?
[i,j]=find(A);
gplot(A,[i,j]);
  1 Comment
Gayathri Nayar
Gayathri Nayar on 22 May 2019
But it plots line between every point in the matrix where there may not be a connection in the image. I mean to say that , in the image 2 points may not be connected using a straight line but can be connected using a curved line. then this code doesnot work the same

Sign in to comment.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!