From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arithmetic mean

Solved!
Go to solution

Hello!

 

Does anyone have the OpenG Arithmetic Mean VI (at least the one for 2D array). I have installed the OpenG Numeric package, but cant find it there.

 

Or maybe even better, does anyone have a VI or a good solution for calculating the mean of columns in a 2D array?

 

Greetings

Kristoffer

0 Kudos
Message 1 of 20
(4,903 Views)

CM.png

 

does this Help?


"Should be" isn't "Is" -Jay
Message 2 of 20
(4,896 Views)

Thank you!:)

 

Just a further question: Is there any possibility for also using a time column when calculating the mean? Such that the code take into account the length of the samples as well (given that the sample time is not a fixed value).

 

Greetings

Kristoffer

0 Kudos
Message 3 of 20
(4,860 Views)

There are no native functions that I am aware of (not saying it does not exist).

 

How are your time samples taken? 

ie:  seconds since last sample..?

timestamp?

 

For instance, if it is a timestamp, and they are in an array, you can take the difference from the previous element, and then calculate the mean.

Message 4 of 20
(4,848 Views)

As it is now it is an array of type string, but I am trying to convert the type of the whole array into timestamp. I was then thinking of doing just as you say, taking the difference from the previous element. Do you have any good examples of a loop where this is done?:)

 

Greetings

Kristoffer

0 Kudos
Message 5 of 20
(4,833 Views)

This will do if the timestamp string is local specific

scan.png

 

If your timestamp string is in a different format

Here is a link to the Formats you would use

E.G. %<%Y/%M/%d %I:%M:%S %p>T  would create a timestamp from "2012/04/10 2:04:51 PM"


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 20
(4,807 Views)

Broken Link-  Don't know what happened

 

Here


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 20
(4,801 Views)

Hello!

 

I have transformed the 2D array from string to timestamp! I was more thinking of a good structure for taking the difference from the previous element when the array is of type timestamp.

 

Greetings

Kristoffer

0 Kudos
Message 8 of 20
(4,775 Views)

nothing simpler

aa.png

 


"Should be" isn't "Is" -Jay
Message 9 of 20
(4,769 Views)

Thanks again. But, that will be for a 1D array if I'm not wrong? My array is a 2D, so i guess i'll need to either add a loop for iterating both columns and rows or something?

 

Greetings

Kristoffer

Message 10 of 20
(4,765 Views)