The following Matlab project contains the source code and Matlab examples used for truncated multivariate normal.
X = rmvnrnd(MU,SIG,N,A,B) returns in N-by-P matrix X a
random sample drawn from the P-dimensional multivariate normal
distribution with mean MU and covariance SIG truncated to a
region bounded by the hyperplanes defined by the inequalities Ax<=B.