Performing operation row by row on several waves
I have several waves in a table that I would like to perform several operations on , row by row across the several columns and store the results in a new wave. For example compute the averages of the first point, second point etc. across waves and have those values stored in a new wave. I've been experimenting with the Wavestats function but I can't seem to get it to do exactly what I want. Any suggestions?
February 25, 2015 at 01:33 pm - Permalink
A.G.
WaveMetrics, Inc.
February 25, 2015 at 02:52 pm - Permalink
February 25, 2015 at 07:31 pm - Permalink
February 25, 2015 at 11:42 pm - Permalink
For example:
If you want to keep the extracted 1D waves, instead of overwriting temp you can use a string that depends on i as a name for the new wave, e.g.:
March 20, 2015 at 08:24 am - Permalink
Actually this is a very good example of code that may work but is far from ideal in terms of performance. Here are a few things that you can do to streamline it:
(1) your loop does not change the dimensions of the wave matrix so keep the upper limit of the loop from being evaluated as a function on each iteration:
(2) it is normally not a good idea to allocate a wave inside the loop unless you have to do so. In this case the make command could be factored out of the loop so the code should look like:
(3) you can improve the above using MatrixOP:
March 20, 2015 at 08:48 am - Permalink