Can anayone please help me on this , I have a random array and reapeating number, and i want the output must be in series, like 1,2,3 etc , but non reapeating.. just like below. thanks
I just did to sort on those array using Sort 1D Array, but how to find for unique value? what should i use ? thanks
to find unique elements you usually step over your array to copy elements from one array to a second one. And you only copy elements not present in the second array…
FOR each element in array1 IF element not present in array2 add element to array2 ENDIF NEXT
This is where conditional indexing tunnels and feedback nodes come in handy.
Since you have the array sorted, all you have to do is check to see if the current element matches the previous. Use a Feedback Node to hold the previous value. Then use a conditional indexing output tunnel on your value. If not equal to previous value, set the condition to TRUE.
There's also lots of OpenG functions that can help you do all this. Of course for a learning exercise you should probably figure out how to do it on your own. In the end a custom solution will probably use less memory, and less execution time then using OpenG stuff too.
OpenG knows nothing about the data you are passing it. For instance if the data is already sorted you can use some optomizations in array functions. OpenG has to assume that an array is not sorted, and so will usually take longer performing operations that might not be needed.