Faster Method for removing duplicates
4 views (last 30 days)
Show older comments
I am trying to remove duplicate nodes from an auto mesh. I have attached a simple script. This works, but takes FOREVER if there are many (greater than 10,000) nodes. Does anyone have an alternate suggestion that would be faster?
node =
[0.1234 5.6789;
3.4567 9.8765;
4.5678 8.7654;
0.1234 5.6789]
% Remove duplicate nodes
node_array=cell(1,length(node));
for j = 1:length(node)
node_array(j,1) = {node(j,:)};
end
node_array_cat = cat(1,node_array{:});
[node junk node_map] = unique(node_array_cat,'rows');
node =
[0.1234 5.6789;
3.4567 9.8765;
4.5678 8.7654]
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements 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!