我是MATLAB新手,刚从网络上下了一个ASIAN权证定价程序学习,运行后
% AsianMC.m
function [P,CI] = AsianMC(S0,X,r,T,sigma,NSamples,NRepl)
Payoff = zeros(NRepl,1);
for i=1:NRepl
Path=AssetPaths1(S0,r,sigma,T,NSamples,1);
Payoff(i) = max(0, mean(Path(2:(NSamples+1))) - X);
end
[P,aux,CI] = normfit( exp(-r*T) * Payoff);
MATLAB显示出如下:
??? function [P,CI] = AsianMC(S0,X,r,T,sigma,NSamples,NRepl)
|
Error: Function definitions are not permitted at the prompt or in scripts.
请问我的程序那里出了问题了?拜托了各位