MATLAB: MATLAB code partially completes task – no error.

loopsremoving rowstable

Hello all,
I have a table that consists of about 30,000 to 40,000 rows of data (depending on input file), once the table is produced, I have a segment of code that combs through three specific columns marking each position where the value is less than 2. The second segment then goes through this newly created matrix, removing any duplicates, and then removes the rows with any value less than 2 in the three columns from the original table. Each time I run these two segments, the size of my table will decrease by about 2 or 3, but then the code stops running without showing any error message. I don't know if there is a problem with my code or if I am processing too much at once. Thank you for your assistance! (MATLAB Version: 9.3.0.713579 (R2017b))
%First Segment
vox_min = 2; %threshold value
removesmall = []; %Initial array for collecting positions of values less than vox_min
for k = 1:size(pore_char.BoundingBox, 1)
for j = [4, 5, 6]
if pore_char.BoundingBox(k,j) < vox_min
removesmall = [removesmall, k]; %collects all positions less than vox_min
end
end
end
%Second Segment
removesmall_unique = unique(removesmall); %removes duplicate rows to ensure correct rows are deleted
for i = 1:size(removesmall_unique)
pore_char(removesmall_unique(i), :) = []; %removes rows with values less than vox_min
end

Best Answer

  • If my comment helps you enough could you accept this answer?