I am trying to understand the while
statement in MatLab so this is what I did:
i=0;
while i<=20
disp(i)
i=i+1;
end
and as I expected, MatLab displayed numbers 0-20. However with this one:
j=0;
while j<=2
disp(j)
j=j+0.1;
end
MatLab only displays numbers 0-1.9. I expected to see numbers 0-2; what am I doing wrong here?