integrating over a symfun
显示 更早的评论
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 !
回答(1 个)
Philipp
2017-5-20
Using matlabFunction(f) works:
syms f(x)
f(x) = x+2
ans = integral(matlabFunction(f),1,2)
类别
在 帮助中心 和 File Exchange 中查找有关 Special Values 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!