
Divide a 3D wave by a 1D wave layer by layer

mgalenb
I am trying to improve the speed of a function which divides each layer of a 3D wave by a scaler read from a 1D wave with the same number of pnts as the number of layers in the 3D wave. I cant figure out the correct MatrixOp expression or if it is even possible to do this. I can do the manipulation with the p,q,r indexers just fine:
Function testfunc() Make/O/N=(256,256,600) images = 0 Make/O/N=600 wav2=p+1 Duplicate/O images result multithread result=images[p][q][r]/wav2[r] End any suggestions?
wav2
3d and just make the division?idk which is faster.
edit:
best,
_sk
March 9, 2018 at 01:34 am - Permalink
March 9, 2018 at 01:52 am - Permalink
edit: removed the "= 0" from the make w_res command and everything sped up but option 4 is still the fastest by ~4x
March 9, 2018 at 08:43 am - Permalink
March 9, 2018 at 12:13 pm - Permalink
I get an error when I run that "While executing MatrixOP the following error occurred: Bad MatrixOPs token."
PS: I use Igor 6.37
March 19, 2018 at 02:55 am - Permalink
Igor 6.x is a bit old and does not support the full range of options that are available in IP7 or IP8. I really recommend upgrading to IP7. If you upgrade now you will get a free upgrade to IP8.
A.G.
March 19, 2018 at 10:31 am - Permalink