Averaging part of a 2D wave by index stored in another 1D wave
Wed, 11/27/2019 - 08:00 am
I have a logical problem to solve.
Part of my code is looking for values that fall under certain conditions (namely, I'm looking for elements of a 1D wave that exceeds certain total values and store indexes of that exceedance (puffind.ibw) and the logical values of exceedance (logical.ibw)). Now, I need to average counts_raw.ibw using either logical or puffind indexes in such a manner that the algorithm will take the first batch of columns with the logical==1 and store it in a temporary 2D wave. Then I will take that wave and average each column to get 1 row of values for each column which will be stored in a 2D wave, e.g. averages (then kill the temporary 2D wave). Next, the algorithm should proceed with the logical to the next bunch of true values and extract another 2D temp wave for averaging. The loop should stop at the end of the logical.ibw or puffind.ibw
I was trying to get the extraction limits by looking for abrupt changes in puffind.ibw but that didn't work well. In Matlab, I would use variable assignment using logical TRUE/FALSE and cellarray that can store different lengths of variables in one place. What is an alternative in IGOR?
I hope you will be able to help me with that. Thank you.
Igor Pro 8
Igor XOP Toolkit
Igor NIDAQ Tools MX