matlab fzero 问题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-
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 11:18:48
matlab fzero 问题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-
matlab fzero 问题
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);
求解释,怎么改?,急
matlab fzero 问题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-
x1和x2的值是多少.我猜你的i没加绝对值变成负数了,然后sqrt(i)是复数,fzero就报错了.error说起始值必须是实数.