![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
matlab fzero 问题
functionv=dxt2(x1,x2)n=0.0109;d=sqrt((x2(1)-x1(1))^2+(x2(2)-x1(2))^2);i=(x2(2)-x1(2))...
function v=dxt2(x1,x2)
n=0.0109;
d=sqrt((x2(1)-x1(1))^2+(x2(2)-x1(2))^2);
i=(x2(2)-x1(2))/d;
y=2.5*sqrt(n)-0.13-0.75*sqrt(2.2/4)*(sqrt(n)-0.1);
x=fzero(@(x)1/n*2.2/4*(1-sin(x)/x)^(y+1/2)*2.2^2/8*(x-sin(x))*sqrt(i)-0.6,0.5);
a=2.2^2/8*(x-sin(x));
v=d*a;
调用是错误:
??? Error using ==> fzero
Function value at starting guess must be finite and real.
Error in ==> dxt2 at 6
x=fzero(@(x)1/n*2.2/4*(1-sin(x)/x)^(y+1/2)*2.2^2/8*(x-sin(x))*sqrt(i)-0.6,0.5);
求解释,怎么改??,急 展开
n=0.0109;
d=sqrt((x2(1)-x1(1))^2+(x2(2)-x1(2))^2);
i=(x2(2)-x1(2))/d;
y=2.5*sqrt(n)-0.13-0.75*sqrt(2.2/4)*(sqrt(n)-0.1);
x=fzero(@(x)1/n*2.2/4*(1-sin(x)/x)^(y+1/2)*2.2^2/8*(x-sin(x))*sqrt(i)-0.6,0.5);
a=2.2^2/8*(x-sin(x));
v=d*a;
调用是错误:
??? Error using ==> fzero
Function value at starting guess must be finite and real.
Error in ==> dxt2 at 6
x=fzero(@(x)1/n*2.2/4*(1-sin(x)/x)^(y+1/2)*2.2^2/8*(x-sin(x))*sqrt(i)-0.6,0.5);
求解释,怎么改??,急 展开
1个回答
展开全部
x1和x2的值是多少。我猜你的i没加绝对值变成负数了,然后sqrt(i)是复数,fzero就报错了。error说起始值必须是实数。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询