array(p) --- return a single array showing the part numbers of elements. If p is the partition { {1,2,4} {3,5,6} {7,8,9,10} } then array(p) gives the array [1 1 2 1 2 2 3 3 3 3].
0001 function a = array(p) 0002 % array(p) --- return a single array showing the part numbers of elements. 0003 % If p is the partition { {1,2,4} {3,5,6} {7,8,9,10} } then array(p) gives 0004 % the array [1 1 2 1 2 2 3 3 3 3]. 0005 0006 n = nv(p); 0007 a = zeros(1,n); 0008 0009 c = parts(p); 0010 for k=1:length(c) 0011 a(c{k}) = k; 0012 end