I don't know what's going on but when I use i = 0.1:0.1:7
in my code I get the integers 1 and 2, it then skips 3 but gets 4, 5, 6 and 7 no problems.
x=zeros((t_f/h)+1,1);
x(1,1)=0;
table=zeros(t_f,1);
for i=0.1:0.1:7;
x(round(i/h)+1,1)=i;
if ~mod(i,1)
table(i,1)=i;
end
end
Then to test I returned these
table
a=[x(1) x(11) x(21) x(41) x(51) x(61) x(71)]
a=[x(1) x(11) x(21) x(31) x(41) x(51) x(61) x(71)]
It's not finding 3 as an integer because i never is 3, it's 3.000... but 1, 2, 4, 5, 6 and 7 are integers.