MATLAB: ADDING ZEROS to the front of array

array

May I ask for help
I have two arrays like A=[ 111000 ] & B=[ 1111000 ]
I would like to make A become [0111000],or for example if B=[101111000],A becomes[000111000].
Thank you

Best Answer

newA = [zeros(1, max(0, numel(B)-numel(A))), A]