error in submatrix operation in MatrixOP
lee.2338
The following code, which worked fine in older versions like igor 7, throws an error in igor 9 due to "Bad range specification".
MatrixOP/O/S wDataMeanZ = mean(wData[][][p])
I basically want to create a 1D array "wDataMeanZ" with the size of the layer by taking the mean of the row-column space of the 3D matrix "wData", but I want to keep the code concise with 1 line as above. Is there any other similar code that replaces this without using a lengthy function like for-loop?
I'm not sure how this could have worked in IP8 because the index 'p' is not something you can use in MatrixOP.
I suggest you use MatrixOP layer() function instead of the bracket notation.
July 25, 2022 at 09:48 am - Permalink
In reply to I'm not sure how this could… by Igor
then you probably need a wrapper function such as:
function wrapper(wave w, variable i)
MatrixOP/FREE avg = mean(layer(w,i))
return avg[0]
end
or you could use
ImageStats/BEAM wData
July 26, 2022 at 01:35 am - Permalink