integrating over a symfun
Mostrar comentarios más antiguos
hello,
can I integrate over a symfun ?
the following doesn't work:
---
syms f(x)
f(x)=x+2 %just a simple example
ans=integral(f,1,2) % for integrating over f(x) between x=[1,2]
---
any ideas ? thanks !
Respuestas (1)
Philipp
el 20 de Mayo de 2017
Using matlabFunction(f) works:
syms f(x)
f(x) = x+2
ans = integral(matlabFunction(f),1,2)
Categorías
Más información sobre Special Values 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!