According to my code I always have real positive integer indexes. (i>1 and 2i-1>1 so I should not have any problem) Can you see what is going wrong here?
Thanks, Amadeus
>> vector=tracks(1,2).matrix
vector =
   33.7275   96.5223   27.9644
   31.7655   95.9838   28.9847
   30.6771   95.9896   29.0000
>> length=tracks(1,2).nPoints
length =
     3
>> for i=length:-1:1 
vector(2i-1,:,:)=vector(i,:,:);
end 
Subscript indices must either be real positive integers or logicals.
>> for i=length:-1:1 i end
i =
     3
i =
     2
i =
     1