How to perform zero-padding to 3 dimensional array Consider an array with $t=10000$ rows, $i=2$ columns and $n=41$ as a 3rd dimension. Now I add the columns of this array to yield a matrix with $t$ rows and $n$ columns. However in MATLAB the size of my new matrix X is:

size(X) = 10000   1   41


I want to add $10000$ zeros to each of the columns of this matrix. This should give a matrix with: 

size(X) = 20000   1   41


I would try this code:

X_zeros = [X;zeros(10000,41)];


However, apparently the dimensions of X and zeros(10000,41) are not matching. I assume it is because of my 3rd dimension, although this 3rd dimension is empty. I want to delete this 3rd dimension s.t. : 

size(X_zeros) = 20000   41


This is not an option: 

X_zeros = [X,zeros(10000,1,41)]


because I assign X_zeros to other matrices with only $2$ dimensions. Is there a way?
A lovely cat ("concatenate arrays along specific dimension") can do the job:

a = randn(10000,1,41);b= cat(1,a,zeros(size(a)));whos b