how to estimate/evaluate the integral of a constant value function?
古いコメントを表示
For example, f = 5, for 0<t<1, zero otherwise.
i tried the following code but it didn't work:
syms t
f = 10;
int(f)
採用された回答
その他の回答 (1 件)
Just Manuel
2021 年 2 月 23 日
Try this:
syms t
f = 0*t + 10;
int(f);
Cheers Manuel
3 件のコメント
Jinquan Li
2021 年 2 月 23 日
Just Manuel
2021 年 2 月 23 日
編集済み: Just Manuel
2021 年 2 月 23 日
you can't use piecewise in a numerical context. redefine your function as follows:
f = @(t) 5 .* (t > 0 & t < 1);
% then you can calculate numerical integral like this
integral(f, -1, 1)
Cheers
Manuel
Jinquan Li
2021 年 2 月 23 日
カテゴリ
ヘルプ センター および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
