I have a 3D array (image) with the dimensions of 256 x 3527 x 8. I wish to divide all the values by the 3rd dimension by a vector of 1 through 8.
For example, my vector looks like:
Esun = [1 2 3 4 5 6 7 8]
In each layer of the image of size 256 x 3527 (of 8 layers), I want to divide it by the respective value in Esun.
If MATLAB doesn't have such a function, will it be faster to cut my 3D array into 8 pieces and run it through a loop, or turn Esun into a 3D repetitive array and do a matrix division?