symbolic integral inside a numerical one. How to program it?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Shashank Prasanna
am 3 Jul. 2013
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!