06-15-2005 07:30 AM
06-16-2005 01:33 PM
06-17-2005 04:41 AM
06-24-2005 11:03 AM
10-18-2010 03:31 AM
Hello,
I have a problem regarding standard deviation, too. Please give me a hand with it.
I load several channels ( the number may be different all the times) with DataFileLoadSel command, and one of the channels that I load have only one value.
I need to calculate the standard deviation of this channels ( the channels that have only one value "OpForce"), but I don't know how to define the StatBlockCalc command, because on the ChnNoStr field I don't know what to write, to include all the groups with the channel.
The groups are random named ( I don't know why), and for that I do not know the name of the group, only the name of the channels inside.
Attached is pictured with the data portal and script, to have a better ideea about the task.
Thank you for your time,
Marius
10-18-2010 07:55 AM
Hi Marse,
According to the VBScript you posted a screenshot of, the names of your Groups are coming from the names of the data files you're loading. They don't look random to me, but I don't know what files you selected. Regarding the standard deviation calculation, in general the standard deviation of 1 value is either that value itself or undefined. Do you perhaps mean that you want to calculate the standard deviation of the N single values stored accross the N "OpForce" channels in the various Groups?. You can calculate with the StatBlockCalc() command "row-wise" accross the values of multiple channels, though I'm not sure if it will let you do that with N channels that just have 1 value each. If that doesn't work you can create a new channel containing only the values you want to calculate from. Here's a brief (untested) outline of how to build the channel string of those N channels for the row-wise (Block) standard deviation calculation:
ChnStr = ""
FOR iCount = 0 TO UBound(MyFileNames)
Call DataFileLoadSel(....)
OpForce = CNoXGet(GroupCount, 4)
ChnStr = ChnStrAdd(ChnStr, OpForce)
NEXT
Call StatBlockCalc("Block", "1", ChnStr)
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-19-2010 01:22 AM
Thank you Brad, for your help.
" ChnStr = ChnStrAdd (ChnStr, OpForce) " it was just what I had needed.
I use your way to load and name channels and I had build using StatSel(2) = "Yes" command a new channel.
After that I calculate the standard deviation from the "sum" channel.
Thank you for your time and have a good day.
Marius