numerical integration with nonarray function
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
Yao Li
el 12 de Abr. de 2013
Assuming
x=[x0,x1,x2];
B=[det(x0*A) det(x1*A) det(x2*A)];
trapz(x,B)
Roger Stafford
el 12 de Abr. de 2013
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)
1 comentario
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!