symbolic integral inside a numerical one. How to program it?
1 次查看(过去 30 天)
显示 更早的评论
Hi guys,
I need to compute an integral
tau(T)=integral(a(u)*exp(-int(b(s),s,0,u),0,T);
so, I need to declare two functions a(u) and b(s) first and then compute the integral for specified T.
Somehow I always encounter problems when using this method. Please, help me!
Daniel.
0 个评论
采纳的回答
Shashank Prasanna
2013-7-3
If you are deriving a(u) and b(s) symbolically then you will need to convert them into matlab functions before you use them for numerical computations:
Here's an example:
syms x
y = x^2
yFun = matlabFunction(y)
integral(yFun,0,1)
Here's the documentation for matlabFunction:
6 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!