09-03-2013 01:28 PM
Hello,
I am trying to take the moving standard deviation of a 2D array, and I'm super new to LabView. The way I want this VI to work is to have it take data in 3 unit chunks, take the standard deviation, then put it into an array. Then it would move over one unit then take the standard deviation of the next three units, and so on until it had finished with that row, then move down to the next row. I have attached what I have done so far. Basically, what's happening is the VI is taking the standard deviation of the first three, then moving both down one row and over one column, so it's kind of going diagonal across the array. First time posting here so my apologies if I have made any social faux-paus. Thanks in advance 🙂
09-03-2013 01:47 PM
First, the feedback nodes are unnecessary and your code in the outer for loop does nothing.
Feed the iteration (i) of the outer loop into the inner one (this will indicate the Row you are working on). Use this and Index Array to get row i from the 2D array. Then, use the iteration of the inner loop and Array Subset to get the values you want to use for calculating the St. Dev.
09-04-2013 08:09 AM - edited 09-04-2013 08:12 AM
Make sure you understand how this little program works. There are a lot of array functions available for you on the pallette. Don't try to get too fancy, because you'll most likely just run into trouble (like you did with that "feedback node", with which I have no idea what you were trying to do).
By the way, you need at least 3 data points for a standard deviation, so you can only legitimately calculate two less than the number of data available in this situation.
(Looking at pjr's (Mr/Ms 1121's) post, I believe the attached is just what he said to do. Sorry for the spoiler.)
Cameron