Try
[p,q] = meshgrid(vec1, vec2);
pairs = [p(:) q(:)];
See the MESHGRID documentation. Although this is not exactly what that function is for, but if you squint at it funny, what you are asking for is exactly what it does.
Try
[p,q] = meshgrid(vec1, vec2);
pairs = [p(:) q(:)];
See the MESHGRID documentation. Although this is not exactly what that function is for, but if you squint at it funny, what you are asking for is exactly what it does.