Computing the double integral of a surface

조회 수: 4 (최근 30일)
Andromeda
Andromeda 2021년 10월 30일
댓글: Andromeda 2021년 10월 30일
I am trying to compute the double integral of a surface but I keep getting the error "First input argument must be a function handle." and I do not understand what that means. How can I get around this error? See attached picture below.

채택된 답변

Alan Stevens
Alan Stevens 2021년 10월 30일
Like this
syms x y
z = @(x,y) x.^2 + y.^2;
surface_int = integral2(z,1,2,4,9);
disp(surface_int)
233.3333
  댓글 수: 3
Alan Stevens
Alan Stevens 2021년 10월 30일
The @(x,y) is Matlab's way of defining an in-line function of x and y (rather than having z(x,y) as you might find in other programs).
The .^, rather than just ^ indicates raise to the power element by element if x (or y) is more than a single scalar value when the function is called. Since integral2 calls the function, z, with a matrix of values, .^ is needed.
Andromeda
Andromeda 2021년 10월 30일
Okay, thanks again!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by