www.gusucode.com > bioinfo 案例源码程序 matlab代码 > bioinfo/CreateABiographObjectExample.m

    %% Create a biograph object
% This example shows how to create a biograph object. 

% Copyright 2015 The MathWorks, Inc.


%%
% Create a biograph object with default node IDs, and then use the |get|
% function to display the node IDs.
cm = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0];
bg1 = biograph(cm)
%%
% 
get(bg1.nodes,'ID')
%%
% Create a biograph object, assign the node IDs, and then use the |get|
% function to display the node IDs.

cm = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0];
ids = {'M30931','L07625','K03454','M27323','M15390'};
bg2 = biograph(cm,ids);
get(bg2.nodes,'ID')
%%
% Display the biograph object.
view(bg2)