07-07-2014 12:53 AM
Hi,
Cand you suggest how to implement the below functionality . I have a 1dimentional array. I want to search a number in array which is not present but i want to knw the index of the number where it lies in between. For example array contains 1, 2, 4 , 5 and i need to find element 3 , which is not present. But it lies between 2 and 4 . So i want to get the index of number 2 and 4.
Thanks
Vikas
Solved! Go to Solution.
07-07-2014 01:01 AM
(Next time try to use a more useful subject line. This is the LabVIEW forum and every single post is about LabVIEW!)
Are the values always sequential? What if the array is [-2, 7, 4, 9, -12, 55} for example? What if the gap is more than one element wide?
What have you tried so far? Show us what you tried and we will give you suggestions on how to improve it.
07-07-2014 01:09 AM
Hi,
The values in array are in increasing order. i want to find the in which range the search element lies example .. array values are 2 5 8 10 and my search element is 7 .Then i want the result as 1 , 2 which are the index of elements 5 and 8. This is because 7 can fall in between 5 and 8
Thanks
07-07-2014 01:26 AM
Your specifications seem incomplete. For example, what should the output be if the search element exists?
Again, what have you tried so far and what is giving you problems?
Have you tried "threshold array", then round the result down to the next integer for the lower of the two values, and add 1 for the higher value.
07-07-2014 01:57 AM
Hi,
Thank you so much. I have used threshold 1d array function and got the solution