matlab的inline函数报错Error using inline/feval (line 23)Not enoug
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/08/19 14:43:07
matlab的inline函数报错Error using inline/feval (line 23)Not enough inputs to inline function
我的代码如下:
r1 = 60;
Bg = 60;
Sd = Bg/2;
n0 = 1000000000;
k = 2*pi/Bg;
z = 60;
syms x
y = inline('900-z^2-x^2+2*z*x*cos(angle(besselh(1,1,2*pi*x/60))-angle(besselh(1,1,2*pi*z/60)))','x','z');
[r2,f] = fsolve(y,z);
报错:
Error using inline/feval (line 23)
Not enough inputs to inline function.
Error in fsolve (line 241)
fuser = feval(funfcn{3},x,varargin{:});
Error in myrfun (line 12)
[r2,f] = fsolve(y,z);
Caused by:
Failure in initial user-supplied objective function evaluation.FSOLVE cannot continue.
应该是inline用的有问题,因为把inline里面的z都用60这个具体数值替代后,就可以运行了
我的代码如下:
r1 = 60;
Bg = 60;
Sd = Bg/2;
n0 = 1000000000;
k = 2*pi/Bg;
z = 60;
syms x
y = inline('900-z^2-x^2+2*z*x*cos(angle(besselh(1,1,2*pi*x/60))-angle(besselh(1,1,2*pi*z/60)))','x','z');
[r2,f] = fsolve(y,z);
报错:
Error using inline/feval (line 23)
Not enough inputs to inline function.
Error in fsolve (line 241)
fuser = feval(funfcn{3},x,varargin{:});
Error in myrfun (line 12)
[r2,f] = fsolve(y,z);
Caused by:
Failure in initial user-supplied objective function evaluation.FSOLVE cannot continue.
应该是inline用的有问题,因为把inline里面的z都用60这个具体数值替代后,就可以运行了
![matlab的inline函数报错Error using inline/feval (line 23)Not enoug](/uploads/image/z/3924663-15-3.jpg?t=matlab%E7%9A%84inline%E5%87%BD%E6%95%B0%E6%8A%A5%E9%94%99Error+using+inline%2Ffeval+%28line+23%29Not+enoug)
1)syms x z;
2)fsolve的写法不对,要定初值,语法要求是 FSOLVE(FUN,X0,OPTIONS)
再问: 初值就是z,还是谢谢你
再答: z是初值,方程就不能这么写了 900-z^2-x^2+。。。
再问: syms x
syms z
y = inline('900-z^2-x^2+2*z*x*cos(angle(besselh(1,1,2*pi*x/60))-angle(besselh(1,1,2*pi*z/60)))','x','z');
[r2,f] = fsolve(y,60);
我这样写还是报原先的错
2)fsolve的写法不对,要定初值,语法要求是 FSOLVE(FUN,X0,OPTIONS)
再问: 初值就是z,还是谢谢你
再答: z是初值,方程就不能这么写了 900-z^2-x^2+。。。
再问: syms x
syms z
y = inline('900-z^2-x^2+2*z*x*cos(angle(besselh(1,1,2*pi*x/60))-angle(besselh(1,1,2*pi*z/60)))','x','z');
[r2,f] = fsolve(y,60);
我这样写还是报原先的错
matlab的inline函数报错Error using inline/feval (line 23)Not enoug
matlab运行出错Error using ==> inline.subsref at 14 Not enough in
matlab中使用inline 和 nlinfit 报错!
我编辑的matlab函数老是出现这种问题:Error using spirallength (line 9) Not e
matlab 错误Error using zy (line 4) Not enough input arguments.
用MATLAB运行代码后总显示 Error using Untitled (line 2) Not enough inp
inline skate
C中函数inline定义问题,
c++里的inline和()是什么意思?
matlab报错?Error using ==> mpower Inputs must be a scalar and
Matlab ,error using eq
matlab报错?Error:File:D:\matlab7\work\fitness.m Line:1 Column: