我遇到了本主题中描述的同类问题: 使用 fzero: Undefined function or method 'isfinite' for input arguments of 'sym' 类型
他们的回答确实帮助了我,但我仍然陷入困境。
我还必须找到 w 函数的零点,这个函数分几个步骤定义:
所以唯一未知的是w,我定义了其他对象,例如:
lambda= @(w) ((16*rho(i)*A(i)*w^2*Lprime(i)^2)/(E(j)*I(i)))^0.25;
beta=@(w) lambda*b(i)^0.5;
gamma=@(w) lambda*Lprime(i)^0.5;
然后,我定义了一个 4*4 矩阵 M2:
M2=@(w) [besselj(4,beta) bessely(4,beta) besseli(4,beta) besselk(4,beta);
besselj(3,beta) bessely(3,beta) besseli(3,beta) -besselk(3,beta);
besselj(2,gamma) bessely(2,gamma) besseli(2,gamma) besselk(2,gamma);
besselj(4,gamma) bessely(4,gamma) besseli(4,gamma) besselk(4,gamma)];
那么要求解的方程为:det(M2)=0。但是 w=0 是其中一种解决方案,我想要第一个非零解决方案,所以我写道:
delta = @(w) det(M2);
S(i,j)=fzero(delta,500);
然后我运行程序,Matlab 说:
??? Error using ==> fzero at 235
FZERO cannot continue because user supplied function_handle ==> @(w)det(M2)
failed with the error below.
Undefined function or method 'det' for input arguments of type 'function_handle'.
Error in ==> frequencies at 57
S(i,j)=fzero(delta,500);
我还尝试了 subs 和 eval 方法,但它们也不起作用,错误消息是在这些情况下:
??? Undefined function or method 'isfinite' for input arguments of type 'sym'.
Error in ==> fzero at 323
elseif ~isfinite(fx) || ~isreal(fx)
Error in ==> frequencies at 58
S(i,j)=fzero(@(w) subs(delta,'w',w),500);
我猜这与edio的错误相同。和:
??? Error using ==> fzero at 307
FZERO cannot continue because user supplied function_handle ==> @(w)eval(delta)
failed with the error below.
Undefined function or method 'eval' for input arguments of type 'function_handle'.
Error in ==> frequencies at 59
S(i,j)=fzero(@(w)eval(delta),500);
你能帮我吗?