MATLAB: Reshape 4D matrix, keeping the 1st and 2nd dimensions intact

MATLABreshap 4d matrix

Hi
I have a 4D matrixs, the first tow dimentions represent the coordinats, (144,73,17,1460)
What I'm asking for is spletting this matrix to cover the valeus in the 3rd and 4th dimentions, I mean (:,:,i,j) where i = 1:17 and j = 1:1460
and the out put should be Aij following the valeus of i&j respectively (A11,A12…, A12,…A171460)
Thanks in advance

Best Answer

B = reshape(A, 144, 73, []);
The result is a [144 x 73 x 17*1460] array.