How do I remove empty indexes in a structure?
Show older comments
I have a structure generated by the "regionprops" function for image processing.
I ran the following code to remove unwanted regions:
n = numel(stats);
for i=1:n
if stats(i).Area > 50
refinedStats(i,:) = stats(i);
end
end
This gives me a structure with the desired indexes, however the indexes of the ones I removed remain, just with their fields as [].
I was wondering how I remove these indexes from the structure?
Accepted Answer
More Answers (0)
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!