Code covered by the BSD License  

Highlights from
Matgraph

from Matgraph by Ed Scheinerman
Toolbox for working with simple, undirected graphs

Description of parts
Home > matgraph > @partition > parts.m

parts

PURPOSE ^

parts(p) --- returns the parts of p in a cell array

SYNOPSIS ^

function cells = parts(p)

DESCRIPTION ^

 parts(p) --- returns the parts of p in a cell array

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size size(p) --- returns [nv,np]: number of vertices, parts.
This function is called by:
  • array array(p) --- return a single array showing the part numbers of elements.

SOURCE CODE ^

0001 function cells = parts(p)
0002 % parts(p) --- returns the parts of p in a cell array
0003 
0004 [m,n] = size(p.array);
0005 
0006 cells = cell(1,m);
0007 
0008 for k=1:m
0009     cells{k} = find(p.array(m+1-k,:));
0010 end

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

Contact us at files@mathworks.com