I guess I understood the help file wrong. Are the x1 and x2 the index? the way it was described, I thought it means only include elements whose value is between x1 and x2. (especially since -inf doesn't seem to make sense with index)
Posts: 280
Joined: 2007-07-19
Location: United States
koensayr wrote:
I guess I understood the help file wrong. Are the x1 and x2 the index? the way it was described, I thought it means only include elements whose value is between x1 and x2. (especially since -inf doesn't seem to make sense with index)
Igor Help File wrote:
mean(waveName [, x1, x2 ] )
The mean function returns the arithmetic mean of the wave for points from x=x1 to x=x2.
x1 and x2 are the wave scaling indexes over which the mean is computed.
If you have point scaling, they're the indexes of the wave (array), which start at 0 (0 is the index of the first value in the wave, 1 is the second, etc).
See this Igor help topic to explain what wave scaling is and how x isn't usually the point/index number.
Joined: 2007-06-29
Location: United States
Simple: if, for example, the first element of the wave is larger than the mean. Try this:
Make ddd=x
•print mean(ddd,-inf,inf)
63.5
•print mean(ddd,1,inf)
64
// now change so that the first element is larger than the mean:
•ddd[0]=100
•print mean(ddd,-inf,inf)
64.2812
•print mean(ddd,1,inf)
64
I hope this helps,
A.G.
WaveMetrics, Inc.
Joined: 2012-03-07
Location: United States
I guess I understood the help file wrong. Are the x1 and x2 the index? the way it was described, I thought it means only include elements whose value is between x1 and x2. (especially since -inf doesn't seem to make sense with index)
Joined: 2007-07-19
Location: United States
The mean function returns the arithmetic mean of the wave for points from x=x1 to x=x2.
x1 and x2 are the wave scaling indexes over which the mean is computed.
If you have point scaling, they're the indexes of the wave (array), which start at 0 (0 is the index of the first value in the wave, 1 is the second, etc).
See this Igor help topic to explain what wave scaling is and how x isn't usually the point/index number.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.