哪位大好人能不能帮一帮小女子解决这个MATLAB的问题呀?
这个是原始公式,我在MATLAB中写的代码如下:
function F=myfun(x)
E_t=939.84e8;alpha=0.05942;L=1228.84e8;sigma_E=0.3531;T=1;
F=([x(1)*normpdf(log(x(1)/(alpha*L)+x(2)^2*T/2)/x(2))-alpha*L*normpdf(log(x(1)/(alpha*L)+x(2)^2*T/2)/x(2)-x(2)*sqrt(T))-E_t;sigma_E*E_t/(x(1)*normpdf(log(x(1)/(alpha*L)+x(2)^2*T/2)/x(2)))-x(2)]);
E_t=939.84e8;alpha=0.05942;L=1228.84e8;sigma_E=0.3531;T=1;V0=15436.1e8;d0=0;sigma0=0.01;
x0=[V0;d0;sigma0]
options=optimset('TolFun',1e-7);
[x,fval]=fsolve(@myfun,x0,options);
V=x(1);sigma=x(2);
y=(log(L/v*(1-alpha))-sigma^2/2)/sigma;
P=normpdf(y+sigma)-(1-alpha)*(V/L)*normpdf(y)
return
主要疑问有:第一,在主菜单上该怎么运行这个函数?第二,从这个编辑页面上直接点运行始终出现“Error using myfun (line 3)
Not enough input arguments”这个问题,请问该怎么解决?
由于写论文需要用,现在发现真的不知道该怎么办了,希望有懂得的大好人帮帮忙吧。。。