Solved by albanD in post #6 
              
              
                Hi, 
Yes the gradients will flow back properly to the layers above. 
For convolution-like operations, you might want to check the im2col function. It might help you speed up your code depending on what you want.