01-08-2024 02:57 AM
Hi...,
I have a 1D array of elements, I need to delete non repeated elements from that array and also need to print repeated elements only once.
Thankyou.
Solved! Go to Solution.
01-08-2024 03:02 AM
Hi Hemanth,
@stark8 wrote:
I have a 1D array of elements, I need to delete non repeated elements from that array and also need to print repeated elements only once.
Sounds like typical homework…
What have you tried?
Where are you stuck?
Mind to provide your VI with typical input data?
You might rephrase your requirement:
"I need to output those elements from an 1D array that occur atleast twice."
01-08-2024 03:04 AM
01-08-2024 03:12 AM
This the array
01-08-2024 03:24 AM
Hi Hemanth,
and what have your tried so far?
Is the input array always sorted?
Suggestion:
01-08-2024 03:30 AM
Here's the VI what i have tried.
01-08-2024 04:16 AM
01-08-2024 04:22 AM
Hi Hemanth,
Another method would be use InsertIntoSet option in a Loop based on the Size of the Array.
Concatenate the Input Element whenever the already Included output array from the InsertIntoSet Function is True.
In this case you will miss one element for each unique Array element for example for the input "Test1,Test2,Test2,Test3,Test3,Test3,Test4,Test4,Test4,Test4" You will get "Test2,Test3,Test3,Test4,Test4,Test4" as output you will need to append and short the array after the result.
This method will help you to understand how to use Set Function which you may not use frequently.
01-08-2024 04:39 AM
Here's the VI.
01-08-2024 05:44 AM - edited 01-08-2024 05:50 AM