MATLAB: How to pad zeros to each column of a matrix

fftImage Processing Toolboxzero padding

I am given a matrix with t rows and n columns. I want to add zeros to each column. How can I achieve this? I was thinking about the padarray-command:
X_padded = padarray(X,[10000 0]);
But I think this yields a matrix X with only zeros added to it in column n=1.

Best Answer

Here are two easy ways to add zeros onto a matrix:
>> mat = [1,2,3;4,5,6]
mat =
1 2 3
4 5 6
>> [mat;zeros(2,3)]
ans =
1 2 3
4 5 6
0 0 0
0 0 0
>> mat(5,1) = 0
mat =
1 2 3
4 5 6
0 0 0
0 0 0
0 0 0