01-18-2013 05:54 AM
hey...im quite new in LV..
My "big" problem is:
I have 1D array of numbers :
and i wanna build and collect numbers in new 1D array
Like this:
Tnx so much 🙂
Solved! Go to Solution.
01-18-2013 06:01 AM - edited 01-18-2013 06:02 AM
So essentially, you want to remove redundant elements?
Norbert
EDIT: What data type are your elements? If they are integer, it is rather simple.
01-18-2013 06:05 AM
Yes i wanna remove redundant elements.
My data type is "double".
tnx
01-18-2013 08:39 AM
The simplest solution is often the best. You need to sort the array first then check if the current value is same as previous, if so, don't add.
"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books
01-18-2013 08:45 AM
@bsvare wrote:
The simplest solution is often the best. You need to sort the array first then check if the current value is same as previous, if so, don't add.
That solution is good unless they want to keep the original order. To keep the original order, you need to use the Search 1D Array to see if the current element has a duplicate. If it does, delete the duplicate. Perform the search again until no duplicates are found. Then do the same operation with the next element.
01-18-2013 08:57 AM
@crossrulz wrote:
@bsvare wrote:
The simplest solution is often the best. You need to sort the array first then check if the current value is same as previous, if so, don't add.
That solution is good unless they want to keep the original order. To keep the original order, you need to use the Search 1D Array to see if the current element has a duplicate. If it does, delete the duplicate. Perform the search again until no duplicates are found. Then do the same operation with the next element.
So, you suggest more of this:
"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books
01-18-2013 09:02 AM
I suggest to be aware of issues with comparing floating point numbers with "equal" or "not equal"!
Norbert
01-18-2013 09:40 AM - edited 01-18-2013 10:07 AM
"The simplest solution is often the best"
01-18-2013 10:38 AM
@Don_Phillips wrote:
"The simplest solution is often the best"
I think Don has us beat. Oh the things you can find if you take the time to dig around...
01-21-2013 01:16 AM
hey...super...it works...tnx to all 🙂
tnx again 🙂