Im trying to use the integral function without any success...
1 次查看(过去 30 天)
显示 更早的评论
Im trying to use integral to solve the following equation with the bounds from 1 to 4.
I managed to write this as (exp(-(t/3)).* sin(t^2)).
When i enter this in matlab as:
I get the following output :
While my calculator gives me the following???
What am i not getting right here??
0 个评论
回答(2 个)
Walter Roberson
2022-10-6
In the symbolic toolbox, int() and solve() attempt to give indefinitely precise closed-form solutions. If int() is not able to find a closed form solution then it returns the integral unevaluated. If you want numeric results, use vpaintegral() or vpasolve() respectively, or vpa() the result of the int() call, or double() the result of the int() call
format long g
syms t
f = (exp(-(t/3)).* sin(t^2))
d = int(f, t, 1, 4)
vpa(d)
double(d)
vpaintegral(f, t, 1, 4)
Davide Masiello
2022-10-6
syms t
f = exp(-t/3)* sin(t^2);
I = int(f,t,1,4)
This means int cannot compute the value of the definite integral. You could numerically approximate the integral by using vpa.
Fvpa = vpa(I)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!