changeset 17:c674bf769d82

fix infinite loop bug in tree feature identification
author DaveM
date Thu, 16 Feb 2017 10:23:46 +0000
parents 4a8ec6c461a0
children 705e7cd5bee5
files phase2/treeLinkFeatures.m
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/phase2/treeLinkFeatures.m	Thu Feb 16 10:07:42 2017 +0000
+++ b/phase2/treeLinkFeatures.m	Thu Feb 16 10:23:46 2017 +0000
@@ -15,21 +15,22 @@
 listSize = size(data,1);
 
 % linkList(:,4) = 0;
-featureList = cell(listSize-1,1);
+featureList = cell(listSize-1,2);
 currentRow = [2*listSize-1];
 
 %%
 while (~isempty(currentRow))
     if(currentRow(1) > listSize)
-        row = currentRow(1) - listSize
+        row = currentRow(1) - listSize;
+%         rD = linkList(row,4);
         if(linkList(row,4) < depthThresh)
             classList = traceLinkageToBinary(linkList, row);
-            featureList{row} = rfFeatureSelection(data(classList>0,:), classList(classList>0));
-            currentRow = [currentRow(2:end); linkList(row,1); linkList(row,2)];
+            featureList{row,1} = rfFeatureSelection(data(classList>0,:), classList(classList>0));
+            featureList{row,2} = linkList(row,4);
         end
-    else
-        currentRow = currentRow(2:end);
+        currentRow = [currentRow; linkList(row,1); linkList(row,2)];
     end
+    currentRow = currentRow(2:end);
 end
 
 end
\ No newline at end of file