Splitting an array



I am attempting to select certain numbers in an array and place them into two different array.

a=[0:1:100]'; for i=1:length(a)
if a(i)>20 a1(i)=a(i);
else
a2(i)=a(i);
end
end

However, matlab in not doing this as a1 still the same size as 'a' and 'a2' is exactly what i want, why not the same with 'a1'?
.