numerical integration with nonarray function
이전 댓글 표시
Hello, guys,
I have a trouble in using numerical integration command. The integrand in my case is det(x*A),x is the variable, and A is a n*n matrix. I noticed that nearly all the numerical integration command has requirement of array function, which means, they have to use .*, ./ when needed? do we have numerical integration command without such requirement?
Thank you very much!
Clair
채택된 답변
추가 답변 (2개)
Yao Li
2013년 4월 12일
Assuming
x=[x0,x1,x2];
B=[det(x0*A) det(x1*A) det(x2*A)];
trapz(x,B)
Roger Stafford
2013년 4월 12일
With x used as a vector, your integrand can be written as:
(x.^n)*det(A)
with the x factored out, which should integrate very nicely. However, why bother to do numerical integration when the indefinite integral is already known from elementary calculus, namely
x^(n+!)/(n+1)*det(A)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!