Kindly help me integrate this function.
3 ビュー (過去 30 日間)
古いコメントを表示
I am trying to integrate the following expression using 'quad' fuction for all the values of vector 'h' , kindly help me with the code as the vector 'h' is being problamatic to me. Code starts below:
h=1:0.02:10;
f= @(x) ((sin(x)).^2)./(((sin(x)).^2)+(h));
% a, the lower limit
a= 0 ; % b, the upper limit
b= 34 ; answer=quad(f,a,b);
%%% Code ends
1 件のコメント
Star Strider
2014 年 5 月 12 日
I thought we solved this in http://www.mathworks.com/matlabcentral/answers/129173-kindly-help-me-integrate-this-function.
回答 (1 件)
Eugene
2014 年 5 月 12 日
Depends if you're trying a double integral or just evaluating the integral for various values for h. If its NOT a double integral then:
h=1:0.02:10;
f= @(x,c) sin(x).^2./(sin(x).^2+c);
% a, the lower limit
a= 0 ; % b, the upper limit
b= 34 ;
for i=1:length(h);
answer(i)=quad(@(x)f(x,h(i)),a,b);
end
%%%Code ends
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Special Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!