필터 지우기
필터 지우기

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 CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by