Numerical integration twice wrt same variable
显示 更早的评论
Hello people,
I have afunction
and it is calculated by only numerical methods. As an example let's say;

where

And I am asked to calculate; at some points of x, let's say at


I do not how to it. I need to calculate y, and use it as a function of x by numerical integration methods. I write my algortihm down below, and I get of course error. Can someone help me fix it?
Thanks in advanced.
clear
clc
r = 1:5; x = 1:5;
for k = 1:length(x)
y(k) = integral(@(r) ((r+1).^2+1)./r,1,x(k))
I(k) = integral(@(x) (1+y(k)),0,1)
end
5 个评论
Star Strider
2019-2-4
Did my Answer to your previous Question Numerical Integration in Summation sign help in this regard?
I believe I demonstrated the necessary approach there.
Esra Akdogan
2019-2-4
编辑:Esra Akdogan
2019-2-4
Esra Akdogan
2019-2-4
madhan ravi
2019-2-4
Have a look into "ArrayValued" option in integral.
Esra Akdogan
2019-2-4
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!