i need to integral the fu= x^2+y^3 , from 0 to 2 for x and from 2 to 4 for dy . using for loop and int or integral in matlab .can anybody help me?

답변 (1개)

Dyuman Joshi
Dyuman Joshi 2023년 11월 7일

0 개 추천

Use integral2 -
f = @(x,y) x.^2 + y.^3;
out = integral2(f, 0, 2, 2, 4)
out = 125.3333

댓글 수: 1

In case you want to perform symbolic integration -
syms x y
f(x, y) = x^2 + y^3;
out = int(int(f, x, 0, 2), y, 2, 4)
out = 
double(out)
ans = 125.3333

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

카테고리

질문:

2023년 11월 7일

댓글:

2023년 11월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by