
procedure to generate a wave that would be the mean of several waves

daviddoji
If I want to make the average of these waves, I have to type in a console:
duplicate 0__temp, ave__temp ave__temp = (0__temp+1__temp+...)/"number_of_waves"
I would like to make a procedure to do this more automatically and not to type every time these lines. It should be a smart way to do it.
Thanks in advance
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
February 27, 2013 at 09:00 am - Permalink
But if I want to call the procedure for example like this:
average(temp)
I would need that the procedure take all the wave ending with "temp" and make the average. should it be valid this procedure to do it?
Thanks in advance
February 27, 2013 at 10:51 am - Permalink
At the prompt, the "Include NAN points" option will average waves even if some are missing intermediary values (ie, those set to NAN). The "Generate error wave" option computes the standard error on a per point basis for the population of waves. The function will by default move the selected source waves to a folder called "Averaged", or you can use the drop-down menu to leave them alone, delete the source waves, or move them to a custom folder name specified in the "Custom Folder" field.
February 27, 2013 at 01:51 pm - Permalink
WaveList is a function that returns a string containing a semicolon-separated list of waves that match the input criteria. The way I have written it, it lists all waves whose names end in "temp", it puts a semicolon between names, and it doesn't apply any WaveList options (that's the final empty quotes). The function takes a string as input that is used to name the output waves. It creates an average wave and a standard error wave that has the same name with "_STE" appended to the name.
If you have waves data1, data2, data3, data1temp, data2temp, and data3temp, it will list average the last three of those waves. You might invoke it like this:
averageTempWaves("myAverage")
The output will be two waves: myAverage containing the averages, and myAverage_STE containing the standard error. Of course, three inputs isn't enough to make the standard error meaningful, but you get the idea.
Or you can use the Wave Average control panel as a GUI, select by Name in the top menu, and enter "*temp" in the Name Template box.
There is a demo experiment about this package: File->Example Experiments->Ave, Box Plot, Percentile.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
February 27, 2013 at 03:42 pm - Permalink