I have an array of 48 matrices, each of size 49 x 49. I can merge them to form a 3D cube of size 48 x 49 x 49. How can I extract a 'row' of elements along the 3rd dimension to form a vector of 48 elements? I have tried using a for loop but I was wondering if there is a more elegant way of doing it. The Mat.col or Mat.row function only applies in 2D