Hi everyone. I have a program which for the most part is performing as I need, however it seems to be out of sync in one count. The program does the following:
Reads in "Input Data", does a "conversion" and calculates the running standard deviation of incoming data. In this example if you run the program, the STDev at the first point is zero and on the second read in it is 0.1 (STDev of both).
Once the standard deviation falls below 1, it triggers a counter which increments a case structure.
The counter counts from 1-10, and the case structure reads in the next incoming 10 data points, while simultaneously initializing the standard dev (boolean true).
Once 10 points are read in (built an array), other numerical computations are performed and the "conversion" math is updated with a new value for calculations called "corresponding value change".
Returns to reading in "Input Data" with the new "corresponding value change" for conversion and starts the STDev calculations on the new incoming data. STDev initialize is false.
Everything works fine, upon triggering the program reads in 10 data points and calculates the new corresponding value. However, the next read-in point with the updated value should technically be zero, because STDev initialize is now false and there is only one point coming in. This is not the case however, it seems to be using previous "Input Data" values for STDev. I have implemented every possible variation that I can think of for the counter and STDev initializing but I cannot get it to begin new STDev calculations at the first input data after the 10 read-ins. Does anyone have any suggestions as to how this can be modified? Thank you.
Also, please ignore the cosmetics of the program, it is still a work in progress and looks messy.