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!