フィルターのクリア

Integral of combined handle functions

1 回表示 (過去 30 日間)
Tiago Araujo
Tiago Araujo 2021 年 6 月 24 日
コメント済み: Star Strider 2021 年 6 月 25 日
I need to do a integral with a function by combining two functions, something like this:
syms q r
x(q,r) = q + 2*r;
y(q,r) = q*9 + r;
G = @(q,r) x+y
integral2(G,1,2,1,2)
It is only a example, my real problem is much more complex. How can i do that?

採用された回答

Star Strider
Star Strider 2021 年 6 月 24 日
Don’t use the Symbolic Math Toolbox for this.
Create ‘x’ and ‘y’ as anonymous functions instead, then call them in ‘G’:
x = @(q,r) q + 2*r;
y = @(q,r) q*9 + r;
G = @(q,r) x(q,r) + y(q,r);
G = function_handle with value:
@(q,r)x(q,r)+y(q,r)
Gint = integral2(G,1,2,1,2)
Gint = 19.5000
.
  2 件のコメント
Tiago Araujo
Tiago Araujo 2021 年 6 月 24 日
TKS
Star Strider
Star Strider 2021 年 6 月 25 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by