01-22-2015 02:37 AM
Hi all,
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
01-22-2015 02:44 AM
01-22-2015 02:49 AM
I just did to sort on those array using Sort 1D Array, but how to find for unique value? what should i use ? thanks
01-22-2015 03:07 AM
Hi syrpimp,
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
01-22-2015 07:05 AM
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.
01-22-2015 08:05 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord