How do I remove empty indexes in a structure?
显示 更早的评论
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Region and Image Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!