Info
この質問は閉じられています。 編集または回答するには再度開いてください。
I am getting error in this code?
1 回表示 (過去 30 日間)
古いコメントを表示
f=@(x)cos(x)/x q(x)=integral(f,0,10)
i am getting error in evaluating that statements in command window
sorry guys i am very new to MATLAB.
Thanks for ur help
0 件のコメント
回答 (1 件)
Mischa Kim
2014 年 2 月 14 日
編集済み: Mischa Kim
2014 年 2 月 14 日
Rajasekhar, use
f = @(x) cos(x)./x;
q = integral(f,0.1,10)
There is a problem though with f approaching inf as you approach x=0. So you can get close but not all the way.
2 件のコメント
Roger Stafford
2014 年 2 月 14 日
Actually that integral is divergent at the lower limit of zero. As the lower limit, a, approaches zero, the integral approaches plus infinity in a similar way to -log(a).
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!