% AssetPaths.m function SPaths=AssetPaths(S0,mu,sigma,T,NSteps,NRepl) dt=T/NSteps; sidt=sigma*sqrt(dt); % create increments of a Brownian Motion Increments =(mu-0.5*sigma^2)*dt +sidt*randn(NRepl,NSteps); % create trajectory of the Brownian Motion LogPaths=cumsum([log(S0)*ones(NRepl,1), Increments],2); % create trajectory of a Geometric Brownian Motion SPaths=exp(LogPaths);