%DOPutMC(s0,k,r,t,sigma,sb,NSteps,NRepl)function[p,aux,ci]=DOPutMC(s0,k,r,t,sigma,sb,NSteps,NRepl)dt=t/NSteps;nudt=(r-0.5*sigma^2)*dt;sidt=sigma*sqrt(dt);randn('seed',0);rand=randn(NRepl,NSteps);rand1=nudt+sidt*rand;rand2=cumsum(ran...%DOPutMC(s0,k,r,t,sigma,sb,NSteps,NRepl)
function[p,aux,ci]=DOPutMC(s0,k,r,t,sigma,sb,NSteps,NRepl)
dt=t/NSteps;
nudt=(r-0.5*sigma^2)*dt;
sidt=sigma*sqrt(dt);
randn('seed',0);
rand=randn(NRepl,NSteps);
rand1=nudt+sidt*rand;
rand2=cumsum(rand1,2);
path=s0*exp(rand2);
payoff=zeros(NRepl,1);
for i=1:NRepl
ax=path(i,:);
if min(ax) |
|