I am simulating in Matlab a Normal Random Variable $X$ with mean $E(X)=0$ and variance $\text{var}(X)=1$, using the built-in randnfunction.
However I am noticing that in order for the mean $(\frac{1}{N} \sum_{n=1}^N X_n)$ and variance $(\frac{1}{N} \sum_{n=1}^N X_n^2 - (\frac{1}{N} \sum_{n=1}^N X_n)^2)$ of the set of realizations $(X_n)_{n\in[1..N]}$ of this random variable to reach $0$ and $1$, respectively, with an error lower than $0.01\%$, I need $N$ to be at least higher than $10^4$.
Is there any way to reach a mean and variance of the set of realizations close to the theoretical values with less than $0.01\%$ error but with much less realizations $N$ (on the order of 10 typically). In order words is there any other way to program a probability distribution in Matlab that converges faster than randn to a gaussian distribution with given mean and variance?
Your observation is very correct: sample mean converges to a limiting Normal with $O(1/\sqrt{n})$ rate, thanks to the central limit theorem. So you used $n=10^4$ points to get an error of $\varepsilon=10^{-2}$.
Unfortunately, also by the CLT no distirbution can have a sample mean that converge faster than $O(1/\sqrt{n})$, provided that its variance is finite. So if you are using sample mean of $n$ independent random variables, nothing can beat what you currently have.