x1 = n1 x 1 vector of variables in first distribution

x2 = n2 x 1 vector

C1 = n1 x n1 covariance matrix

C2 = n2 x n2 covariance matrix

You need to figure out the cross-covariance values between elements of x1 and elements of x2. If you can assume that the values are independent, then XC12 is all zeros.

XC12 = n1 x n2 cross-covariance matrix between x1 and x2

x12 = transpose(x1 x2)

C12 is the (n1+n2)x(n1+n2) covariance matrix for x12

C12 = [ C1 XC12 ]

[ transpose(XC12) C2 ]