ECI2MeanElements:

--------------------------------------------------------------------------
   Computes mean orbital elements from reference ECI position and velocity

   Since version 7.
--------------------------------------------------------------------------
   Form:
   [elRefMean, dElMean] = ECI2MeanElements(xRefECI, xRelECI, J2);
--------------------------------------------------------------------------
   Note: it is assumed that all inputs have the same time-tag.

   ------
   Inputs
   ------
   xRefECI          (6,1)    reference position & velocity in ECI frame
   xRelECI          (6,:)    relative positions & velocities in ECI frame
   J2                (1)     size of J2 perturbation

   -------
   Outputs
   -------
   elRefMean        (1,6)    mean orbital elements of the reference orbit
   dElMean          (:,6)    mean orbital element differences

     NOTE: Both element sets are in Alfriend format [a,theta,i,q1,q2,W]

--------------------------------------------------------------------------
  References:  Terry Alfriend, Texas A&M University
               Joe Mueller, Princeton Satellite Systems
--------------------------------------------------------------------------

Children:

FormationFlying: Transformation/Osc2Mean
Orbit: OrbitCoord/El2Alfriend
Orbit: OrbitCoord/OrbElemDiff
SC: BasicOrbit/RV2El