How can I integrate several functions in a single call to the QUAD or QUADL functions?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Editada: MathWorks Support Team
el 31 de Oct. de 2022
I would like to integrate the functions "f1(t)", "f2(t)", and "f3(t)" each over the interval "t = (0, 1)" using the QUAD function.
f1.m, f2.m, and f3.m over the same interval. Can I write a function that returns a 3-by-n matrix, whose first, second, and third rows are the values of "f1", "f2", and "f3", respectivelys and pass this function to QUADL?
Respuesta aceptada
MathWorks Support Team
el 14 de Oct. de 2022
Editada: MathWorks Support Team
el 31 de Oct. de 2022
This enhancement has been made for Release 14 (R14). For previous product releases, please read below for any possible workarounds:
The QUADV function introduced in MATLAB 7.0 (R14) performs vectorized quadrature. Create a function that returns a vector value where the first, second and third rows represent the evaluations of "f1", "f2", and "f3", respectively. For more details on how this function works, including an example of how to use this function, see the documentation at:
The QUAD and QUADL functions do not support this type of operation. You must evaluate these integrals using seperate calls to QUAD or QUADL.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!