フィルターのクリア

Im trying to use the integral function without any success...

1 回表示 (過去 30 日間)
Edward Ekman
Edward Ekman 2022 年 10 月 6 日
コメント済み: Edward Ekman 2022 年 10 月 6 日
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??

回答 (2 件)

Walter Roberson
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))
f = 
d = int(f, t, 1, 4)
d = 
vpa(d)
ans = 
0.26625810440816920193698247934548
double(d)
ans =
0.266258104408169
vpaintegral(f, t, 1, 4)
ans = 
0.266258
  1 件のコメント
Edward Ekman
Edward Ekman 2022 年 10 月 6 日
Thank you for a fast and well written responce :)

サインインしてコメントする。


Davide Masiello
Davide Masiello 2022 年 10 月 6 日
syms t
f = exp(-t/3)* sin(t^2);
I = int(f,t,1,4)
I = 
This means int cannot compute the value of the definite integral. You could numerically approximate the integral by using vpa.
Fvpa = vpa(I)
Fvpa = 
0.26625810440816920193698247934548
  1 件のコメント
Edward Ekman
Edward Ekman 2022 年 10 月 6 日
Thank you for a fast and well written responce :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by