09-22-2011 08:44 AM
Be patient. You posted in the middle of the night for the US. So there aren't as many people on the forums. Why didn't you start your own new thread rather than posting into a 6 year old one?
Your question is not very clear. Are you looking to delete duplicates? Are you looking to be left with an array in order once the duplicates are deleted?
09-22-2011 10:35 AM
First of all I could not find any link to create a discussion.
Let me clear the problem
say x is a 1D array having 100 elements
x=[45 45 46 46 46 47 47 46 47 48 48 49 49 49 49 50 51 51 ..............................] 100 elements
Now I want to extract the under line numbers and thier corresponding indices and store them separately.
I have used "delete arrary" but it keeps the unwanted numbers as zero.
Hope this time the problem is clear.
With Regards
Abhijit Das
IITG INDIA
09-22-2011 10:51 AM - edited 09-22-2011 10:54 AM
@Raju1 wrote:
First of all I could not find any link to create a discussion.
Let me clear the problem
say x is a 1D array having 100 elements
x=[45 45 46 46 46 47 47 46 47 48 48 49 49 49 49 50 51 51 ..............................] 100 elements
Now I want to extract the under line numbers and thier corresponding indices and store them separately.
I have used "delete arrary" but it keeps the unwanted numbers as zero.
Hope this time the problem is clear.
On top of the LabVIEW forum is a button labeled "new message". click it and follow the three step instriuctions. It is not difficult.
I don't see the rules you use to extract the indices. For example why do you ignore the first occurence of the number 49? Seems random.
There is no "delete array" function. "delete from array" does NOT keep zeroes. If you think it does, attach your code.
What kind of output do you want? An array of number plus an array of indices? An array of clusters, each containing a number and an index?
Your example has a very distinct pattern (e.g. your array is sorted!). Can we assume this to be true in general or should we assume that the array can be more random?
09-22-2011 11:03 AM
Sorry for the mistake
It should be
x=[45 45 46 46 46 47 47 46 47 48 48 49 49 49 49 50 51 51 ..............................] 100 elements
I want [45 46 47 48 49 50 51 .......] and its indices [1 3 6 10 12 16 17.....] separately in arrays.
The array can be more random. The selected number will be 1 or 2 greater than the previous one.
With Regards
-Abhijit Das
IITG, INDIA
09-22-2011 11:47 AM
09-22-2011 12:01 PM
Thanks for your replays-
My LabVIEW version is 7.
The numbers are integers.
With Regards
-Abhijit Das
IITG, INDIA
09-22-2011 12:38 PM
Agree with altenbach. It's a pretty straightforward solution and you should have tried it (assuming you just want incrementing series of numbers from an array). Here's my solution. I'm sure you could optimize it.
Regards,
09-22-2011 01:10 PM - edited 09-22-2011 01:11 PM
Here's a quick draft that is easier to copy from an image, because it has no case structures. 😉
09-22-2011 01:36 PM
I am getting the expected results.
Thanks a lot.
-Abhijit Das
IITG, INDIA
09-23-2011 02:27 AM
My take. 🙂
/Y