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
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 10:33:03
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中syms构建函数后用fsolve求解
例如:
syms x
y=x^2-1;
fsolve(y,-2)
结果报错:
Error using ==> lsqfcnchk at 111
If FUN is a MATLAB object,it must have an feval method.
Error in ==> fsolve at 184
funfcn = lsqfcnchk(FUN,'fsolve',length(varargin),funValCheck,gradflag);
请问怎么解决
不用function_handle(@)的情况下 怎么解决
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
思路有点混乱,syms x;y=x^2-1;fsolve(y,-2);你算的是x=2,y=(-2)^2-1还是:
-2=x^2-1 求x.
如果是前者使用subs
如果是后者,直接写到一起