MATLAB: Repeat last column and last row of a matrix

matrix manipulation

i have a matrix of 63*64.i want to repeat the last colum and get a matrix of 63*65? my next matrix is 62*65. I want to repeat the last row and get the matrix of 63*65?

Best Answer

A(:,end+1)=A(:,end)
For the second matrix
A(end+1,:)=A(end,:)