How can I upgrade the multi variable integration?

Hello. I'd like to integrate the multi variable equation as attached using trapezoidal integral.
So I made the code as attached abbreviated m-file and function.
However, in the original code I made, it takes too many time because I used many for-end structure.
I'm trying to reduce the calculation time, but it's too hard to me. Could you please help me or recommend any thing for that?
Many Thanks indeed, Best regard.
(I'm using MATLAB 2015a.)

 채택된 답변

Kuifeng
Kuifeng 2016년 4월 9일
%see example of matlab, use double or triple trapz,
F = X.^2 + Y.^2;
I = trapz(y,trapz(x,F,2))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

질문:

2016년 4월 9일

답변:

2016년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by