Computing an specific numerical Integral
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
Can anyone help me in computing the following integral?
Thanks
![integral.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/270565/integral.jpeg)
2 件のコメント
採用された回答
David Hill
2020 年 2 月 8 日
You could just expand the sumations since there are only 5.
fun=@(x)(.5*(1-x).^4+6*x.*(1-x).^3+4.5*x.^2.*(1-x).^2+4*x.^3.*(1-x)+.5*x.^4).*log(.5*(1-x).^4+6*x.*(1-x).^3+4.5*x.^2.*(1-x).^2+4*x.^3.*(1-x)+.5*x.^4);
y=integral(fun,0,1);
3 件のコメント
David Hill
2020 年 2 月 8 日
You could play with somethng like this.
w=[.1 .3 .3 .2 .1];%size w will have to increase with n
fun=@(x,n)sum(reshape(cell2mat(arrayfun(@(y)w(y)*factorial(n)/factorial(y-1)/factorial(n-y).*x.^(y-1).*(1-x).^(n-y),1:n,'UniformOutput',false)),length(x),[]),2);
z=integral(@(x)fun(x,5).*log(fun(x,5)),0,1,'ArrayValued',true);%n=5
その他の回答 (1 件)
Stijn Haenen
2020 年 2 月 8 日
I think you should use a Riemann integral to estimate the answer of this integral.
Or maybe wolfram Mathematica can solve it for you.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!