MATLAB: How to pad zeros to an array

pad zeros

Hi
I have an array of data of size 5.I have to pad zeros to set the size as 10.How to add zeros of size 5.Help me please…

Best Answer

A=[1 2 3 4 5]
A=[A zeros(1,5)]
%or
A(end+1:end+5)=0