function ConfidenceInterval(x) % x is the standard normal random variable array % Example: ConfidenceInterval(randn(1,100)) lowerBound=mean(x)-1.96.*std(x)./sqrt(length(x)); upperBound=mean(x)+1.96.*std(x)./sqrt(length(x)); fprintf('The 95 percent confidence interval for the mean of x is (%0.3f, %0.3f) \n',lowerBound,upperBound)