MATLAB: For loop indexing per allocating

for loopindexing

how can I write the following loop for all t values from 0 to 10, I tried this but I got an error saying
"Index in position 1 is invalid. Array indices must be positive integers or logical values."
for t=0:0.1:10
LA(t/0.1 +1) = 1.15-(5*t);
end

Best Answer

LA(t/0.1+1)=1.15-(5*t);
%.....^ indexing value must be positive integer
Just an examples :
LA(0.02)>> Not allow
LA(1)>> Allow
LA(0)>> Not allow
May this one?
t=0:0.1:10
for i=1:length(t)
LA(i)=1.15-(5*t(i));
end