Hi i have, probably an easy, problem. I made a function (see the outcome below) and i need to integrate the outcome, but since the interval is small the subscript indices aren't integers. This is the problem:
0.0028 0.1333 0.2667 0.4000 0.5333 0.6667 0.8000 0.9333 1.0667 1.1972
So then i use the Simpson Rule:
a = 0; b = 1.2; n =10; h = (b-a)/n
I = h/3*(f(xi(1))+2*sum(f(xi(3:2:end-2)))+4*sum(f(xi(2:2:end)))+f(xi(end)));
But i get the error: Subscript indices must either be real positive integers or logicals.
How can I solve this?