join(g,h1,h2) --- overwrite g with the join of h1 and h2
0001 function join(g,h1,h2) 0002 % join(g,h1,h2) --- overwrite g with the join of h1 and h2 0003 0004 global GRAPH_MAGIC 0005 0006 n1 = nv(h1); 0007 n2 = nv(h2); 0008 0009 z = logical(ones(n1,n2)); 0010 0011 rmxy(g); 0012 0013 0014 GRAPH_MAGIC.graphs{g.idx}.array = ... 0015 [GRAPH_MAGIC.graphs{h1.idx}.array, z; ... 0016 z', GRAPH_MAGIC.graphs{h2.idx}.array 0017 ]; 0018 0019 0020 if (hasxy(h1) & hasxy(h2)) 0021 xy = [getxy(h1);getxy(h2)]; 0022 embed(g,xy); 0023 end