I replaced normrnd(0,1,n-1,1)
with randn(n-1,1)
.
They both generate a vector of random numbers from the standard normal distribution (mean=0, std=1) but randn
is included in the basic Matlab installation, while normrnd
requires an additional toolbox.