Is any way in Matlab to perform definite integral with conditions in the integration domain?
Mostrar comentarios más antiguos
Basic example;
f(x)= x^2+3*x for x<100 f(x)=x^3 for x>100; a=10; b=200;
d=integral(f(x), a, b)
Note: this is a basic example, I know for something like the equation above with the int function in symbolic tool box can be resolve easily doing two independent indefinite integrals and then transforms its results in functions and then evaluate those functions (one function in the interval a the other function in the interval b) to obtain the result. However the equation I’m working is very complex, and when I try to find its indefinite integral with the int function, I'm receiving the following warning error " the explicit integral can't been found". For that reason I’m trying to figure out if the integral function could work having some limitation in the integration domain.
I will appreciate whatever help that can point me out to resolve this issue. Thanks
Respuesta aceptada
Más respuestas (1)
Wayne King
el 27 de En. de 2014
Editada: Wayne King
el 27 de En. de 2014
Using integral()
integral(@(x) x.^2+3*x,10,100)
integral(@(x) x.^3,100,200)
You just integrate your first function from 10 to 100 since it is defined for x<100. x^2+3*x
Integrate the second function from 100 to 200 because it is defined for x>100, x^3
1 comentario
Categorías
Más información sobre Numerical Integration and Differentiation 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!