Hi all.
I have been stuck in this problem for quite a while now and I still don't know how to continue. Some outside input would be greatly appreciated!!
I'm trying to do the following:
- Take an array of numbers, check if they are inside of a certain range (ex. between 2 and 4)
- Build two new arrays: one with all the numbers that are inside the range, and one with the rest.
An additional condition is that the amount and value of range conditions will change (for example, it could be between 2 and 4 only/ 2 and 4 AND 6 and 7 depending on the input)
To process this, I created two nested for loops - one that goes over an array that includes the range conditions and the inside one that actually goes and checks if the values are within the range. I think I've done this part successfully, but the next part is confusing to me - how do I actually create the separate arrays within the two for loops?
My apologies if I did not explain this well. Another method of conveying this problem is that I want to translate the following into Labview:
Array ranges // ex. [1 5 7 10] -> this means we want to split numbers based on those which are in (1,2) and (4,5) vs. those that aren't
Array values // [2 3 6 11 3]
Array inValues // Array for values inside range
Array outValues // Array for values outside range
for m = 1:size(ranges)
for n = 1:size(values)
if (THE NUMBER IS INSIDE EITHER RANGE)
inValues = [inValues NEWNUMBER]
else
outValues = [outValues NEWNUMBER]
end
end
end
Seems easy enough, but it gets so chaotic with Labview that I don't know what to do. I've attached a picture for reference - the insert into array function doesn't actually add into the array, it creates a new array. How can I save that up for when the nested for loop ends?
I've seen some examples with shift registers that are within one loop and I could not successfully transfer that into my block diagram.
Any help/direction would be greatly appreciated.
"currently i am using .INI file in labview application