Find commontimes

バージョン 1.0.0.0 (2.66 KB) 作成者: M Sohrabinia
Finds common date-times from two or more date-time vectors with a given tolerance in seconds
ダウンロード: 191
更新 2013/6/6

ライセンスの表示

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

引用

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

MATLAB リリースの互換性
作成: R2011b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0