for a homework assignment I need to create two equivalent vectors, x1 and x2, using two different methods in Matlab. This should be pretty straight forward however I am getting an error I do not understand.
x1 = linspace(2,14,61);
x2 = 2:.2:14;
These should create equivalent vectors correct? However, the 8th element of each is supposedly "different".
x1(8)
ans =
3.4000
x2(8)
ans =
3.4000
x1(8) == x2(8)
ans =
0
Can someone explain to me why this is? All indexes not a multiple of 8 do not exhibit this behavior. Only the 8th, 16th, etc.