function kids=getkids(handle); % function kids=getkids(handle); % % Display the children of a given object % base_type=get(handle,'type'); if strcmp(base_type,'root') depth = 3; end if strcmp(base_type,'figure') depth = 2; end if strcmp(base_type,'axes') depth = 1; end kids=get(handle,'children'); nkids=length(kids); for i=1:nkids, type = get(kids(i), 'type'); disp([int2str(i),' ',type]); if depth > 1, gkids = get(kids(i), 'children'); ngkids = length(gkids); for j=1:ngkids, type = get(gkids(j), 'type'); disp([' ',int2str(j),' ',type]); if depth > 2, ggkids = get(gkids(j), 'children'); nggkids = length(ggkids); for k=1:nggkids, type = get(ggkids(k), 'type'); disp([' ',int2str(k),' ',type]); end end end end end