% TINORMRAND  [randval]=tinormrand(mu,sigma,c,N)
% This M-file generates a independent truncated normal 
% random sample on [-c,c] using acceptance-rejection method.
%
% Inputs: mu    - mean vector
%         sigma - covariance matrix
%         c     - parameter
%         N     - sample size
%
% Output: randval - random sample
%
% Created: 7-Oct-2003  Last modified: 14-Oct-2003

function [randval]=tinormrand2(mu,sigma,c,N)

n=size(mu,2); randval=zeros(N,n);
for i=1:N
    randval(i,:)=(sigma*randn(n,1)+mu')';
end
