Home > matgraph > @graph > get_label.m

get_label

PURPOSE ^

get_label(g) or get_label(g,v) --- get vertex label(s)

SYNOPSIS ^

function out = get_label(g,v)

DESCRIPTION ^

 get_label(g) or get_label(g,v) --- get vertex label(s)
 get_label(g) returns a cell array of the labels of the vertices
 get_label(g,v) returns v's label

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function out = get_label(g,v)
0002 % get_label(g) or get_label(g,v) --- get vertex label(s)
0003 % get_label(g) returns a cell array of the labels of the vertices
0004 % get_label(g,v) returns v's label
0005 
0006 global GRAPH_MAGIC;
0007 
0008 if ~is_labeled(g)
0009     disp('graph is not labeled');
0010     out = {};
0011     if nargin==2
0012         out='';
0013     end
0014     return
0015 end
0016 
0017 if nargin==2
0018     out = GRAPH_MAGIC.graphs{g.idx}.labels{v};
0019     return
0020 end
0021 
0022 out = GRAPH_MAGIC.graphs{g.idx}.labels;

Generated on Thu 13-Mar-2008 14:23:52 by m2html © 2003