LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Independent PtByPt calcs on array's elements

Solved!
Go to solution

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... 😞

 

VI.jpg

0 Kudos
Message 1 of 5
(2,511 Views)
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.
0 Kudos
Message 2 of 5
(2,495 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(2,486 Views)
Solution
Accepted by topic author Blokk

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.

 

DynamicMean.png

Message 4 of 5
(2,466 Views)

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,

0 Kudos
Message 5 of 5
(2,454 Views)