フィルターのクリア

Question on initial value problem

1 回表示 (過去 30 日間)
Zeynep Toprak
Zeynep Toprak 2020 年 4 月 21 日
コメント済み: Ameer Hamza 2020 年 4 月 21 日
I dont exactly understand aything from this question
Isearched what is "deval" and how to use it, but it is difficult to apply what I see in this Website for deval function for the posted question.
please help me to do this, or give some hints, or try to do by myself by the help of your suggestions.
note this is not assignment and like this, I just try to learn matlab by myself on those quarantina days.

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 21 日
編集済み: Ameer Hamza 2020 年 4 月 21 日
Check this code
f = @(x) x.^2;
F = indefint(f, 0, 1, 0);
function F = indefint(f, a, b, Fa)
sol = ode45(@(t,x) f(t), [a b], Fa);
F = @(x) deval(sol, x);
end
function handle 'F', is the integral of on the domain 0 to 1. You can evaluate its value like this
>> F(0)
ans =
0
>> F(0.5)
ans =
0.0417
>> F(1)
ans =
0.3333
If you calculate the intergal by hand, you will get same answer.
  2 件のコメント
Zeynep Toprak
Zeynep Toprak 2020 年 4 月 21 日
thank you very much! take care :)
Ameer Hamza
Ameer Hamza 2020 年 4 月 21 日
I am glad to be of help.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTiming and presenting 2D and 3D stimuli についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by