how can I integrate this function (1/(1+x.^2)) in matlab
3 ビュー (過去 30 日間)
古いコメントを表示
I used many numerical integration methods like integral simpson trapoizal int but the graph is different and not like the one already I have so can I know please how to do this in matlab the function is 1/(1+x.^2) intervals of this integration contains variable called t takes values from [-15:15] now intervals from [ -t^1/2, Inf]
0 件のコメント
回答 (3 件)
Stephan
2018 年 8 月 5 日
編集済み: Stephan
2018 年 8 月 5 日
Hi,
fun = @(x) 1./(1+x.^2)
sol = integral(fun,-15,15)
This gives you the numeric solution in the bounds [-15, 15].
An alternative solution (if you have access to symbolic toolbox) is:
syms x
fun = 1/(1+x^2)
sol_1 = int(fun)
sol_2 = int(fun,0,inf)
sol_3 = int(fun,-15,15)
Best regards
Stephan
11 件のコメント
suez canal university
2018 年 8 月 5 日
1 件のコメント
Walter Roberson
2018 年 8 月 5 日
You cannot avoid that. You have t = -15 to +15 and you want to integrate over -t^(1/2) to infinity, but when t is negative, t^(1/2) is complex.
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!