% Black-Scholes formula, including dividend yield, see p.7 of Clewlow and % Strickland "Implementing Derivatives Models". clear K=100 % strike price S=100 % stock price at time 0 sig=0.2 % volatility T=2 % end-time (in years) ri=0.06 % risk-free interest rate div=0.03 % dividend yield d1=(log(S/K)+(ri-div+0.5*sig^2)*T)/(sig*sqrt(T)); d2=d1-sig*sqrt(T); C=S*exp(-div*T)*(1+erf(d1/sqrt(2)))/2 - K*exp(-ri*T)*(1+erf(d2/sqrt(2)))/2