MATLAB: How to chang matrix size 81x81x30 to 81x81x32 by add row

chang size matrix

Hi all….
I have matrix size 81 x 81 x30 ( 3D )
i want to be 81 x 81 x 32
chang size matrix by add 2 row (zero number)
here the example in this file ( daily_avg_u.mat )

Best Answer

daily_avg_u(:,:,end + (1:2)) = zeros([size(daily_avg_u(:,:,1)),2]);