フィルターのクリア

Check for incorrect argument data type or missing argument in call to function 'isfinite'.

3 ビュー (過去 30 日間)
Tevel Hedi
Tevel Hedi 2022 年 5 月 1 日
回答済み: Star Strider 2022 年 5 月 1 日
c=8;
x=9;
y=10;
f=@(x,y)(f1(x,y,c)+f3(x,y,c));
ff=@(x,y)f2(x,y,c);
eqs=@(x,y)[f(x,y),ff(x,y)];
sols=[0,0];
sols=fsolve(@(x,y)eqs,[2,1]);
function f=f1(x,y,c)
f=x*y-c;
end
function ff=f2(x,y,c)
ff=1-c*x/y;
end
function fff=f3(x,y,c)
fff=1;
end
Trying to learn how to use fsolve and stuck on this. Any help?

回答 (1 件)

Star Strider
Star Strider 2022 年 5 月 1 日
Change ‘eqs’ to be a funciton one one argument, and it works —
c=8;
x=9;
y=10;
f=@(x,y)(f1(x,y,c)+f3(x,y,c));
ff=@(x,y)f2(x,y,c);
eqs=@(b)[f(b(1),b(2)),ff(b(1),b(2))]; % <— Needs To Be Parameterised With One Vector Argument
sols=[0,0];
sols=fsolve(eqs,[2,1])
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
sols = 1×2
0.9354 7.4833
function f=f1(x,y,c)
f=x*y-c;
end
function ff=f2(x,y,c)
ff=1-c*x/y;
end
function fff=f3(x,y,c)
fff=1;
end
.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by