MATLAB: Concatenate along singleton dimension

concatenate

Hi,
Is there a single-step way to concatenate two vectors along the singleton dimension? For example, a 10×1 vector and a 1×25 vector. In some of my scripts the dimensions seem to be unpredictable for reasons I don't feel like digging into, and I have to use reshape every time I want to concatenate.
Thanks.

Best Answer

A=rand(5,1)
B=rand(1,4)
out=[A(:);B(:)]