I need to simplify below loop which is used to create a 3D point cloud. I'm thinking to use something similar to arrayfun or bsxfun. Could you please let me know how to get the index of current element? For example, in below loop Fdx, Dx, Fdy and Dy are constants. And j is the column ID of pixel and i is the row ID of the pixel.
Any line of advice is much appreciated.
Xd(i,j) = (Zd(i,j)/Fdx)*(j-Dx);
Yd(i,j) = (Zd(i,j)/Fdy)*(i-Dy);