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

flip (in)
function out = flip (in)
    %assert(isvector(in))  % WRONG!
    assert(isvector(in) || isempty(in))
    out = in(end:-1:1);
end

%!test
%! in = [1 2 3];
%! out = [3 2 1];
%! out2 = flip (in);
%! myassert(out2, out)

%!test
%! in = [1 2 3]';
%! out = [3 2 1]';
%! out2 = flip (in);
%! myassert(out2, out)

%!test
%! in = [];
%! out = [];
%! out2 = flip (in);
%! myassert(out2, out)

Contact us