02-21-2014 10:57 AM
Hello,
I have a double array as an input, and at every iteration of the main VI, I would like to calculate mean and standard deviation separately on all the elements using PtByPt VI.
Fortunately in my case I know that, the array size is maximum 11. My solution works, but I would like to know what is the best approach if I have to deal with a larger array, and especially if I do not know the max size in advance...
Here it is my solution, and the VI.
thanks!
ps: i renamed the VI extension from vi to vit to trick the buggy uploader... 😞
Solved! Go to Solution.
02-21-2014 11:17 AM
02-21-2014 11:21 AM
@Dennis_Knutson wrote:
The case statement can be removed. Your for loop is auto-indexing the array so all you do is place the function inside it. The case statement is just not required.
Dennis, I think you misunderstood the issue. I thought the same thing until I realized what they are doing. Think of reading a single sample from 11 channels using DAQmx. Now perform a standard deviation on each of the channels over time. This is a tough one. I'm not sure how I would handle it differently.
02-21-2014 11:51 AM - edited 02-21-2014 11:54 AM
It is not too difficult to modify the 'PtByPt' VIs to be RowByRow by changing the state data. But I would probably go the dynamic route first if I knew the number of columns where bounded by a reasonable number.
02-21-2014 12:10 PM
Thanks, I never needed such dynamic call so far, but it is nice to learn something new 🙂
I guess this approach creates N number of memory copies (where N is the size of the input array in my case, 11) of the PtByPt VI, and use them independently?
regards,