Deleting multiple points: UniqueRows
The native unique works using the sortrows algorithm which can be very slow for large models.
Sometimes we need to avoid passing multiple values to functions that do not support those.
In most of these cases we are pretty sure that there are no multiple values but we use unique to be completly sure. If actually there are no multiple values, it is a waste of time to call sortrows.
This what UniqueRows does, it checks if there is a chance to find multiple values and in the worst case pass to sortrows only candidates that can generate a multiple values.
Here is an example on 10^6 3D points randomly generated. Of course it is very rare to find multiple values in random doubles numbers.
Output:
Elapsed time is 1.313679 seconds. Elapsed time is 0.374713 seconds.
If any problems occurs in execution, or if you found a bug, have a suggestion or question just contact me at:
Download Now
Popularity: 17% [?]
Related Posts
Comments
Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!
Include MATLAB code in your comment by doing the following:
<pre lang="MATLAB">
%insert code here
</pre>

















































