MATLAB:Input argument "x" is undefined
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/07/05 11:18:41
MATLAB:Input argument "x" is undefined
程序如下:function F=fun(x)
t=1; % the time,here is one year
std=16000000000; %2011-6-30 short term debt
ltd=1.57538e+12; % long term debt
debt=std+0.5*ltd; % debt value
rf=0.03125 % risk free interest rate
equity=1.0509e+011; %equity value
stdy=0.2045; %yearly volatility
d1=(log(x(1))/debt+(rf+0.5*x(2)^2)*t)/(x(2)*sqrt(t));
d2=d1-x(2)*sqrt(t);
r=exp(-rf*t); % risk free discount rate
nd1=normcdf(d1);
nd2=normcdf(d2);
F=[-stdy+nd1*x(1)*x(2)/equity;x(1)*nd1-debt*r*nd2-equity];
运行之后结果是 Input argument "x" is undefined.
Error in ==> fan at 12
d1=(log(x(1))/debt+(rf+0.5*x(2)^2)*t)/(x(2)*sqrt(t));
程序如下:function F=fun(x)
t=1; % the time,here is one year
std=16000000000; %2011-6-30 short term debt
ltd=1.57538e+12; % long term debt
debt=std+0.5*ltd; % debt value
rf=0.03125 % risk free interest rate
equity=1.0509e+011; %equity value
stdy=0.2045; %yearly volatility
d1=(log(x(1))/debt+(rf+0.5*x(2)^2)*t)/(x(2)*sqrt(t));
d2=d1-x(2)*sqrt(t);
r=exp(-rf*t); % risk free discount rate
nd1=normcdf(d1);
nd2=normcdf(d2);
F=[-stdy+nd1*x(1)*x(2)/equity;x(1)*nd1-debt*r*nd2-equity];
运行之后结果是 Input argument "x" is undefined.
Error in ==> fan at 12
d1=(log(x(1))/debt+(rf+0.5*x(2)^2)*t)/(x(2)*sqrt(t));
![MATLAB:Input argument](/uploads/image/z/966609-9-9.jpg?t=MATLAB%3AInput+argument+%22x%22+is+undefined)
% 这是一个函数,把它保存为 fun.m 后再调用.
>> x=[1 2];
F=fun(x)
F =
1.0e+11 *
-0.0000
-2.3164 % 没有问题
>> x=[1 2];
F=fun(x)
F =
1.0e+11 *
-0.0000
-2.3164 % 没有问题
MATLAB:Input argument "x" is undefined
MATLAB:Input argument "x" is undefined.
matlab问题?Input argument 'X' is undefined.
matlab Input argument "x" is undefined.
matlab?Input argument "a" is undefined.
matlab老是显示input argument '' is undefined
matlab ? Input argument "t" is undefined.
matlab运行结果Input argument "A" is undefined.
matlab错误:Input argument "x" is undefined.Error in ==> overla
matlab程序运行出现?Input argument "x" is undefined.Error in ==> my
MATLAB报错,为什么?Input argument "x" is undefined.Error in ==> m1
在用matlab解微分方程时提示如下信息:Input argument "y" is undefined.Error i