Hello,
I have a 2D-array, column 0 contains the time of the measurement and column 1 the acquired data.
Within a For-loop I check the elements for column 0 one by one if they are within a certain interval (e.g. for interval 1 the element should be >= 0 and < 4, for interval 2 >=4 and <8, etc).
For each element for column 0 that is within the current interval the corresponding element for column 1 is added to an array with the previous elements of column 1 for that interval, this array is passed to the next iteration with a shift register until the value for element x of column 0 is within the next interval (=2). Then some statistics (number of samples, summation�) of the array containing the values for inter
val 1 are calculated. These statistics are stored / added in / to an array containing the previous statistics. Then the next element of column 0 for interval 2 is checked and so on.
All the above works fine until there are no values within an interval, e.g:
Data array: {{1,3,5,13,15,17,18},{2,3,2,1,3,4,1}} should result in the following array: {{2,1,0,2,2},{5,2,0,4,5}}, but instead it displays: {{2,1,1,1,2},{5,2,1,3,5}}. The vi treats value 13 of column 0 as it belongs to interval 3 although it actually belongs to interval 4.
I tried several options but none of them gave the desired result and now I have run more or less into a dead end. Could anyone please help me or give me a hint in which direction to search for a possible solution so that a column {0,0} is added for empty intervals?
The attached VI contains 2 data arrays. In array 1 each subsequent interval contains at least 1 value (this works fine), in array 2 interval 3 (>=8 and <12) does not contain any value resulti
ng in the wrong output.