%EuroMC.m function [Price,CI] = EuroMC(S0,Payoff,r,T,sigma,NRepl,FunPar) nuT=(r-0.5*sigma^2)*T; siT=sigma*sqrt(T); % Evaluate the function `Payoff' at NRepl points that are randomy generated % we need to pass one parameter (strike price) of the function DiscPayoff=exp(-r*T)*feval(Payoff,S0*exp(nuT + siT*randn(NRepl,1)),FunPar(1)); [Price, VarPrice,CI] = normfit(DiscPayoff);