No BSD License  

Highlights from
meet the family

image thumbnail
from meet the family by nathan q
Visualisation of a family tree in the programming contest.

findAncestry1(iii,ngen, multiParents)
function p = findAncestry1(iii,ngen, multiParents)
% list multiparent ancestry of node iii, going back ngen generations

p=[iii multiParents{iii}];
m1=1; m2=length(p);
for k=1:ngen; 
    for i=m1:m2; 
        p=[p multiParents{p(i)}]; 
    end; 
    m1=m2+1; 
    m2=length(p); 
end

return

Contact us at files@mathworks.com