X1=[1 2 3 4]; X2=[2 3];X2_temp = nan*ones(1, length(X1));X2_temp(1:length(X2)) = X2;X = [X1 X2_temp];