This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getedgesbynodeid (biograph)

Get handles to edges in biograph object


Edges = getedgesbynodeid(BGobj,SourceIDs,SinkIDs)



Biograph object.

SourceIDs, SinkIDs

Enter a character vector, cell array of character vectors, or an empty cell array (gets all edges).


Edges = getedgesbynodeid(BGobj,SourceIDs,SinkIDs) gets the handles to the edges that connect the specified source nodes (SourceIDs) to the specified sink nodes (SinkIDs) in a biograph object.


  1. Create a biograph object for the Hominidae family.

    species = {'Homo','Pan','Gorilla','Pongo','Baboon',...
    cm = magic(7)>25 & 1-eye(7);
    bg = biograph(cm, species);
  2. Find all the edges that connect to the Homo node.

    EdgesIn = getedgesbynodeid(bg,[],'Homo');
    EdgesOut = getedgesbynodeid(bg,'Homo',[]);
    set(EdgesIn,'LineColor',[0 1 0]);
    set(EdgesOut,'LineColor',[1 0 0]);
  3. Find all edges that connect members of the Cercopithecidae family to members of the Hominidae family.

    Cercopithecidae = {'Macaca','Baboon'};
    Hominidae = {'Homo','Pan','Gorilla','Pongo'};
    edgesSel = getedgesbynodeid(bg,Cercopithecidae,Hominidae);
    set(bg.edges,'LineColor',[.5 .5 .5]);
    set(edgesSel,'LineColor',[0 0 1]);

Introduced before R2006a

Was this topic helpful?