B(1:end) uses linear indexing. The size of the output is the same as the size of the index (which in your example is a 1xN vector).
B(:) is a special syntax that always returns a column vector.
Loren Shure's blog explained the first syntax as "C = A(B) produces output the size of B unless both A and B are vectors... When both A and B are vectors, the number of elements in C is the number of elements in B and with orientation of A."