MATLAB: Symbolic integral inside a numerical one. How to program it

computationdouble integralintintegral

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.

Best Answer

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: