MATLAB用fsolve解方程H=1.90;lanmuda=1.55;n1=1.55;n2=1.67;n3=1.50;k0=2*pi/lanmuda;r1=sqrt(n^2-n1^2)*k0;r2=sqrt(n2^2-n^2)*k0;r3=sqrt(n^2-n3^2)*k0;fun=@(n)(r2*H-atan(r1/r2)-atan(r3/r2))s= fsolve(fun,1.60)错误信息如下:fun = @(n)(r2*H-atan(r1/r

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 12:54:44
MATLAB用fsolve解方程H=1.90;lanmuda=1.55;n1=1.55;n2=1.67;n3=1.50;k0=2*pi/lanmuda;r1=sqrt(n^2-n1^2)*k0;r2=

MATLAB用fsolve解方程H=1.90;lanmuda=1.55;n1=1.55;n2=1.67;n3=1.50;k0=2*pi/lanmuda;r1=sqrt(n^2-n1^2)*k0;r2=sqrt(n2^2-n^2)*k0;r3=sqrt(n^2-n3^2)*k0;fun=@(n)(r2*H-atan(r1/r2)-atan(r3/r2))s= fsolve(fun,1.60)错误信息如下:fun = @(n)(r2*H-atan(r1/r
MATLAB用fsolve解方程
H=1.90;
lanmuda=1.55;
n1=1.55;
n2=1.67;
n3=1.50;
k0=2*pi/lanmuda;
r1=sqrt(n^2-n1^2)*k0;
r2=sqrt(n2^2-n^2)*k0;
r3=sqrt(n^2-n3^2)*k0;
fun=@(n)(r2*H-atan(r1/r2)-atan(r3/r2))
s= fsolve(fun,1.60)
错误信息如下:
fun =
@(n)(r2*H-atan(r1/r2)-atan(r3/r2))
错误使用 fsolve (line 256)
FSOLVE requires all values returned by user functions to be of data type double.
出错 m11 (line 14)
s= fsolve(fun,1.60)
不要用solve,用slove我会解.

MATLAB用fsolve解方程H=1.90;lanmuda=1.55;n1=1.55;n2=1.67;n3=1.50;k0=2*pi/lanmuda;r1=sqrt(n^2-n1^2)*k0;r2=sqrt(n2^2-n^2)*k0;r3=sqrt(n^2-n3^2)*k0;fun=@(n)(r2*H-atan(r1/r2)-atan(r3/r2))s= fsolve(fun,1.60)错误信息如下:fun = @(n)(r2*H-atan(r1/r
fsolve要求所有内容都是double型,你这里r1,r2,r3
是sym变量,所以出错,改为下面:
f = @(n)sqrt(n2^2-n^2)*k0*H-atan(sqrt(n^2-n1^2)*k0/(sqrt(n2^2-n^2)*k0))-atan(sqrt(n^2-n3^2)*k0/(sqrt(n2^2-n^2)*k0));
>> fsolve(f,1.6)

fsolve要求所有内容都是double型,你这里r1,r2,r3
是sym变量,所以出错,改为下面:
f = @(n)sqrt(n2^2-n^2)*k0*H-atan(sqrt(n^2-n1^2)*k0/(sqrt(n2^2-n^2)*k0))-atan(sqrt(n^2-n3^2)*k0/(sqrt(n2^2-n^2)*k0));
>> fsolve(f,1.6)好,我...

全部展开

fsolve要求所有内容都是double型,你这里r1,r2,r3
是sym变量,所以出错,改为下面:
f = @(n)sqrt(n2^2-n^2)*k0*H-atan(sqrt(n^2-n1^2)*k0/(sqrt(n2^2-n^2)*k0))-atan(sqrt(n^2-n3^2)*k0/(sqrt(n2^2-n^2)*k0));
>> fsolve(f,1.6)

收起

用Matlab的fsolve解方程,本人matlab白痴,求详述! MATLAB中fsolve初值怎么确定?% fsolvef = @(x) x-sqrt(1+x)p = @(x) x^2-x-1x2 = fsolve(f, 1)x3 = fsolve(f, -1)x4 = fsolve(p, 1)x5 = fsolve(p, -1) 用fsolve求解方程,为什么x2初值取1,得到x2 =1.6180No solution found.到底应该怎么取 MATLAB fsolve 解非线性方程(si^4.108*(-29313320863876.9)+si^3.081*(-1455573982281.561)+si^2.054*(17838323550.297)+si^1.027*(-18264.9538))/65.5-si用fsolve 这个方程,为什么找不到值?(no solution found)fsolve stopped because the last MATLAB用fsolve解方程H=1.90;lanmuda=1.55;n1=1.55;n2=1.67;n3=1.50;k0=2*pi/lanmuda;r1=sqrt(n^2-n1^2)*k0;r2=sqrt(n2^2-n^2)*k0;r3=sqrt(n^2-n3^2)*k0;fun=@(n)(r2*H-atan(r1/r2)-atan(r3/r2))s= fsolve(fun,1.60)错误信息如下:fun = @(n)(r2*H-atan(r1/r matlab怎么用fsolve计算x^7+2*x^5+1=0的解? matlab怎么用fsolve函数解非线性方程组? 关于matlab中fsolve的使用当用fsolve解非线性方程组时,x=fsolve(fun,x0),x0是初始矩阵,麻烦最好举个例子说明下, matlab 隐函数求值 方程是h*(log(h/x)-1)=0.9*z 要求输入x和z 得到h的值 怎么用matlab编程呢我用的是fsolve 但是不知道正确的用法 老是报错 谁能给个正确的解答 关于Matlab求解非线性隐式方程组的求解,利用fsolve,solve,或ezplot等自带函数求解,想直接求解x*y=4;x^y=4;的解,我用一下方法及fsolve函数发现求不出来,但是试了其他简单的方程就可以求出来.以下是 用matlab求非线性方程的符号解.sqrt(x^2+y^2)-100=03*x+5*y-8=0这可以用solve吗?求fsolve代码 关于用matlab 求一个高次方程!谁来回答下!function e=e(x)e=x^4+10*x^3+37*x^2+102.055x+120.0;fsolve(e=0);roots(e);不会用matlab 想解一个一元高次方程- 方程如上面 怎么用matlab的fsolve解方程?function q=myfun(p)x=p(1);y=p(2);z=p(3);q(1)=100*cos(x)+150*cos(y)*cos(z)-200;q(2)=100*sin(x)-150*sin(y)*cos(z)-1600*sin(1*pi/180);q(3)=sin(z)-1600*(1-cos(1*pi/180))/L2;x=fsolve('myfun',[0,0,0]',optimset('Display','o Matlab中syms构建函数后用fsolve求解例如:syms xy=x^2-1;fsolve(y,-2)结果报错:Error using ==> lsqfcnchk at 111If FUN is a MATLAB object,it must have an feval method.Error in ==> fsolve at 184funfcn = lsqfcnchk(FUN,'fsolve',length(varar matlab中用solve解参数方程没有解析解,但将参数改成数值就能解出,因此改用fsolve来求解,但初值又不确定用matlab运行[k1,x]=solve('n*k1+m*tan(k1*x)','k1-sqrt(k^2-log(R1/R2)*log(R1/R2)/x^2)','k1','x')没有解析解,其 MATLAB求解非线性方程组用fsolve函数求解建立函数文件fxyz.mfunction F=fxyz(X)x=X(1);y=X(2);z=X(3);F(1)=x^2+y^2+z^2;F(2)=3*x+5*y+6*z;F(3)=x-3*y-6*z-1;给定初值[-1,1,-1],调用fsolve函数求方程的根X1=fsolve('fxyz',[-1,1,-1]',op 关于matlab用fsolve函数解方程组我想用matlab的solve函数解下列方程组:X1+X2+X3=3X1+2*X2+X3=4X1+X2+2*X3=4该如何写?因为我主要是想学习fsolve函数的用法,能不能只用这个函数来解决这问题,网上的百科和 急!请教matlab高手(解含有符号的方程)请问一下怎么解方程0=a-g*sin(g)/cos(g)?(g用a表示出来),其中a是常数,但不是定值.急!如果回答满意还可以加分的.谢谢好心人!我用fsolve函数试了,对确定 matlab 用fsolve解方程组的问题我需要解一个方程组,编了一个cs.m函数文件,然后通过fsolve('cs',[1,1,1,1,1])语句求解,可是总是提示出错,不知道错在哪了,cs.m函数文件代码如下:function f=cs(uu)b1=uu(1);b2=