LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

advice on iterative measurement

I have a measurement computation that results in an array X that I want to control under the following logic :

parameter A = 5, parameter B = 12.
for A=5, B=12
     if size(X) not equal to 3, then increment A = A+1, else record average value of X
(continue incrementing A until size(X) = 3. record this average value of X number, call it X1)
now increment B = B+0.2
    set A back to 5 & repeat : increment A until size(X)=3. record this average value of X number, call it X2)
repeat above until B = 13.
   There should be 6 X numbers (X1, X2, ... X6). Remove the max & min of this X data set. Average the remaining X's. This is the final result.

I'm having difficulty coming up with a clean simple way to do this (especially the part where the X data is simply dropped if it's size is not equal to 3).
Any advice would be appreciated.

Thanks,
ak

0 Kudos
Message 1 of 3
(2,291 Views)
Hi ak,

I am not sure if I completely understand the first portion of the algorithm. Could you please let me know what is causing the X array to increment initially (i.e. what will make size(X)=3)?

In terms of the final part, you may want to simply use the "Max & Min" array function to get these values and then use the "Delete from Array" function to extract the remaining values followed by the "Add Array Elements" and a division by array size to get the average.

I hope this helps.

Best regards,

Steven
0 Kudos
Message 2 of 3
(2,263 Views)
Thanks Steven,

   I had a problem being inside a for or while loop & aborting it based on a case statement (is size(X)==3?).
I've since figured something different out that will do the job.

thanks,
ak

0 Kudos
Message 3 of 3
(2,253 Views)