05-12-2015 08:24 PM
Hi all,,
Here I am stuck at this point. In the attached snippet, I am acquiring data, then save it to an array of a constant size ( 5 elements) . After that, The array will be analyzed to keep the most closer values depends on the standard deviation. Now I need to get the mean value ( just only one mean value) of the final array , but in the current status it will return multiple mean for the same array ( depends on it's size). Please I need some hint to fix that.
Thank you
05-12-2015 09:18 PM
M.A.A.M.
I'm having a hard time understanding what you mean by final array. From what I could tell, you are adding a random number to the array if it is betwen 0.1 and 0.9 then clearing all elements once you reach an array size greater than 5.
I don't understand exactly what you are trying to do but my guess is you want to make use of some basic state machine or producer consumer where you gather inputs into groups of five then process the data once you have an array of five elements.
05-12-2015 09:42 PM
Hello Jacobson,
At first , thanks for response.
You are right, I am adding a random number to an array if it is betwen 0.1 and 0.9 then clearing all elements if the array size is greater than 5. In fact , it's a simulation of data acquisitin system, which may be not available for all members.
Regard to the objective of this Vi, what you guess is right, but in real condition sometimes the data deviate so much from the mean value and i should remove those nonrelevant data and put the relevant data to another array ( Final Data). Now I need only one value from the Final array, this value will be the mean of this array. Hence, this array is dynamic, it will return multiple value of the mean, but I need only one value for each group.