Numerical Integration in Summation sign
Show older comments
Hello guys, if anyone could help me, I'll appreciate it very very much.

x = 1:10;
x1 = 1:10;
p = 1:4
y1 = @(x1) 2.*x1; %in my case I could not calculate it by analytical integration.
for j = 1:length(x1)
y(j) = integral(y1,0,x1(j));
end
% y = 1.0000 4.0000 9.0000 16.0000 25.0000 36.0000 49.0000 64.0000 81.0000 100.0000
for m = 1:length(p)
for n = 1:length(x)
h1 = @(x1) p(m).*(x(n)-y);
h(m,n) = integral(h1,0,x(n));
end
end
Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!