Ok I'm understanding the responses. I think I messed up writing the code for h=
Since h is the step size for x, I changed x=[1,H,2] which should create a certain number of points depending on .5^[2:13].
H=.5.^[2:13];
nH=length(H);
a=1;
b=2;
for k=1:nH
x=[1:H:2];
y=log(1+x);
I=(y(1) + y(nH) + 2.*sum(y(2:end-1))).*h.*.5
end
My only error now is...
Attempted to access y(12); index out of bounds because
numel(y)=5.
This means that when k=5, H=.03125. So there will be 64 points between 1 and 2 correct? I don't understand why it isn't able to produce a y value for every 64 points. Any clarification would be appreciated. Thanks!