DaveM@16: function linkList = depthCheck(linkList) DaveM@16: DaveM@16: listSize = size(linkList,1)+1; DaveM@16: DaveM@16: linkList = cat(2,linkList, zeros(size(linkList,1),1)); DaveM@16: currentRow = size(linkList,1); DaveM@16: r = [0;0]; DaveM@16: % depth = 1; DaveM@16: DaveM@16: linkList(currentRow,end) = 1; DaveM@16: % depth = depth + 1; DaveM@16: %% DaveM@16: while (~isempty(currentRow)) DaveM@16: row = currentRow(1); DaveM@16: for i = 1:2 DaveM@16: r(i) = linkList(row,i); DaveM@16: if(r(i) > listSize) DaveM@16: r(i) = linkList(row,i) - listSize; DaveM@16: linkList(r(i),end) = linkList(currentRow(1),end)+1; DaveM@16: currentRow = [currentRow; r(i)]; DaveM@16: end DaveM@16: end DaveM@16: currentRow = currentRow(2:end); DaveM@16: end DaveM@16: end DaveM@16: DaveM@16: DaveM@16: DaveM@16: % linkList = aglomCluster(data); DaveM@16: % listSize = size(data,1); DaveM@16: % DaveM@16: % % linkList(:,4) = 0; DaveM@16: % featureList = cell(listSize-1,1); DaveM@16: % currentRow = [2*listSize-1]; DaveM@16: % DaveM@16: % %% DaveM@16: % while (~isempty(currentRow)) DaveM@16: % if(currentRow(1) > listSize) DaveM@16: % row = currentRow(1) - listSize DaveM@16: % classList = traceLinkageToBinary(linkList, row); DaveM@16: % featureList{row} = rfFeatureSelection(data(classList>0,:), classList(classList>0)); DaveM@16: % currentRow = [currentRow(2:end); linkList(row,1); linkList(row,2)]; DaveM@16: % else DaveM@16: % currentRow = currentRow(2:end); DaveM@16: % end DaveM@16: % end DaveM@16: % DaveM@16: % end