MATLAB で 2 つの非線形方程式を解きたいので、次のようにしました。
私のスクリプトの一部
c=[A\u;A\v];
% parts of code are omitted.
x0=[1;1];
sol= fsolve(@myfunc,x0);
myfunc
機能は次のとおりです
function F = myfunc(x)
F=[ x(1)*c(1)+x(2)*c(2)+x(1)*x(2)*c(3)+c(4)-ii;
x(1)*c(5)+x(2)*c(6)+x(1)*x(2)*c(7)+c(8)-jj];
end
私には2つの未知数がx(1)
あり、x(2)
私の質問は、呼び出すたびに値(、、)を渡す方法c
ですか?ii
jj
myfunc
またはこのエラーを克服する方法Undefined function or method 'c' for input arguments of type 'double'.
ありがとう