MATLAB: Struggling to add values to an array using while loop

matrix manipulationwhile loop

I am trying to create a table using the while loop function. The error I get is: "Index in position 1 is invalid. Array indices must be positive integers or logical values."
Here is my code:
v0 = 100;
theta = 25;
t = 0.1;
while t <= 1.0
vx=cos(theta*pi/180)* v0 * t;
vy=sin(theta*pi/180)* v0 * t;
table(t*10,1) = t
table(t*10,2) = vx
table(t*10,3) = vy
t = t + 0.1
end

Best Answer

>> cumsum(0.1*ones(1,10))*10 - (1:10)
ans =
Columns 1 through 5
0 0 4.44089209850063e-16 0 0
Columns 6 through 10
0 0 -8.88178419700125e-16 0 -1.77635683940025e-15
You have round-off problems.