Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
この方法で quad 関数を使用しました。
F = @(x)1./(x.^3-2*x-5); Q = quad(F,0,2);
しかし今、私のF関数は次のように変更されました:
F = @(x,y) y./(x.^3-2*x-5);
他のループ内で Quad を使用しているため、反復ごとに y 値を取得しています。
私はそのようにQuadを使用しようとしました:
Q = quad(F(y),0,2);
しかし、引数が足りないというエラーが発生します。私に何ができる?
でのみ定義された無名関数を使用して、が既知の場合xに評価できますF(x,y)y
x
F(x,y)
y
Q = quad(@(x) F(x,y), 0, 2)