Find commontimes

Finds common date-times from two or more date-time vectors with a given tolerance in seconds
191 Descargas
Actualizado 6 jun 2013

Ver licencia

This function is useful when two or more datasets with different time
periods are available, and the goal is to compare only the common records
which are available in all datasets. It needs AT LEAST 2 date vectors and
finds common times in those two (or more) vectors. Each time in times1
will be matched with all times in times2 vector with a tolerance given in
prec_sec (precision in seconds). The default value for prec_sec is 5
seconds. Additional time vectors can be given (handled by varargin).
If any time does not exist even in one dataset, it will be ignored in the output.

Inputs:
times1: first times vector numeric or string format
times2: 2nd times vector numeric or string format
prec_sec: precision level in comparing times in seconds
varargin: 1 to n additional time vectors
Outputs:
commontimes: string vector of common times in all input time vectors.
idxs: original indexes of matched records from all input time vectors;
this can be used to re-organize other data-fields of datasets based on
the corresponding time vectors of each dataset. For example, if first
timeVec is from dataset1, the first column in idxs matrix will be the
original indexes of matched records in dataset1. Similarly, the
second, 3rd, ... columns of idxs can be used to extract common records
of dataset 2, 3, ... .
dtAll: a matrix of all input time vectors in Matlab's numeric date
format (can be used to validate the results).
cmntNum: common times in Matlab's numerical date format

Citar como

M Sohrabinia (2024). Find commontimes (https://www.mathworks.com/matlabcentral/fileexchange/42118-find-commontimes), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2011b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Dates and Time en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0