MATLAB: How to resize a matrix

matrix arraymatrix manipulation

I have a matrix A of dimension 129*135. I want to make it 135*135 by adding some NaN values. How is it possible in a simple way?

Best Answer

a=rand(129,135) % Example
a(end+1:135,:)=nan