function bscall(s,k,r,sg,t) d1=(log(s/k)+(r+sg^2/2)*t)/sg/sqrt(t); d2=d1-sg*sqrt(t); nd1=normcdf(d1,0,1); nd2=normcdf(d2,0,1); bscall=s*nd1-k*nd2*exp(-r*t); %Black-Scholes call option pricing model