% Sample paths for Example 8.6.1 Glasserman
function sPaths = MakePaths(S0,r,delta,sigma,T,numSteps,numScenarios)
numAssets = 2;
sPaths = zeros(numScenarios, numSteps, numAssets);
dt = T/numSteps;
drift = (r-delta-sigma^2/2)*dt;
vol = sigma*sqrt(dt);
for s = 1:numScenarios
    % make two sample paths, one for each asset
    Increments =  drift+vol*randn(numSteps,numAssets);
    LogPaths = cumsum([log(S0)*ones(1,numAssets); Increments]);
    sPaths(s,:,:) = exp(LogPaths(2:end,:)); % get rid of initial price
end 