% [meo] = mei2meo(mei) transform mrx coordinates into meo (xyz)
%
%Initial version: Niklas Edberg, Swedish Institute of Space Physics, Uppsala, Oct 2005

function [meo] = mrx2meo(mrx,jd)

    meo=ones(size(mrx));    % declare the variabel before to speed up the loop!

    d=jd-2451454;                        % Time in julian days from J2000
    omega = 176.634 + 350.89198226.*d;    % Angle from inertial system to prime meridian through Airy-0 (Mars answer to the Greenwich prime median). Taken from Duxbury et al.

    for i=1:length(mrx)
        T=R(omega(i).*pi./180);
        meo(:,i)=T*mrx(:,i);  % rosettas coord
    end