forked from sandialabs/MATLAB_PV_LIB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpvl_exceltime2matlab.m
More file actions
24 lines (23 loc) · 831 Bytes
/
pvl_exceltime2matlab.m
File metadata and controls
24 lines (23 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function MatTime = pvl_exceltime2matlab(ExcTime)
% PVL_EXCELTIME2MATLAB Convert a Microsoft Excel time to a MATLAB datenum
%
% Syntax
% ExcTime = MatTime = pvl_exceltime2matlab(ExcTime)
%
% Description
% Converts a Microsoft Excel serial time to a MATLAB datenum.
% Specifically, it converts from Excel's "1900" date system (days from
% Jan-1-1900 00:00:00)to MATLAB's datenum date system (days from
% Jan-1-0000 00:00:00).
%
% The input ExcTime is an array of dates in MS Excel's serial 1900 date
% system.
%
% Output MatTime is an array of dates in MATLAB's datenum date system.
% MatTime is of the same size as ExcTime.
%
% See also PVL_MATLABTIME2EXCEL PVL_RMBTIME2MATLAB DATENUM DATEVEC
p= inputParser;
p.addRequired('ExcTime',@isnumeric)
p.parse(ExcTime);
MatTime = p.Results.ExcTime + 693960;