If you want to add a dark edge (that's what the zeros will be), at the bottom and to the right:
load mandrill
[m n] = size(X);
X = [ [X;zeros(1,n)] zeros(m+1,1)];
At the top and to the left:
load mandrill
[m n] = size(X);
X = [ zeros(m+1,1) [zeros(1,n);X] ];
Plus the two other alternatives, with the same principle:
X = [[zeros(1,n);X] zeros(m+1,1)];
X = [ zeros(m,1) [X;zeros(1,n+1)] ];
Best Answer