Code covered by the BSD License  

Highlights from
mydate

mydate

by

 

16 Apr 2011 (Updated )

Augments MATLAB's date/time library for improved handling of epochs and formats commonly used in GPS

mydatebod (epoch)
function [num0, vec0] = mydatebod (epoch)
%MYDATEBOD: Return epoch at beginning of the day containing input epoch.
    if isempty(epoch),  num0 = [];  vec0 = [];  return;  end
    if (size(epoch,2) == 1)
        % epoch is in mydatenum format
        num = epoch;
        vec = mydatevec(num);
    else
        % epoch is in mydatevec format
        vec = epoch;
    end
    %% define the epoch corresponding to the beginning of that day:
    vec0 = vec(:,1:3);
    num0 = mydatenum(vec0);
end

Contact us