Watch this Author's files
There is a bug in the function "eci2ecef". The transformation of the velocity vector from ECI to ECEF frame is not correct. The line V_ECEF(:,j) = R3(GST(j))*V_ECI(:,j) has to be replaced by something like
EARTH_RATE = 7.2921151467e-5; V_R = cross([ 0 0 EARTH_RATE ], ECI(:,j)); V_ECEF(:,j) = R3(GST(j))*(V_ECI(:,j) - V_R');
Contact us at files@mathworks.com