how to use datefind function?

2 ビュー (過去 30 日間)
pruth
pruth 2016 年 2 月 16 日
回答済み: Titus Edelhofer 2016 年 2 月 16 日
in help, I found this
Superset = datenum(1999, 7, 1:31);
Subset = [datenum(1999, 7, 10); datenum(1999, 7, 20)];
Indices = datefind(Subset, Superset, 5)
Indices =
5
6
7
8
9
10
11
12
13
14
15
15
16
17
18
19
20
21
22
23
24
25
here tolerance = (Optional) Tolerance (+/-) for matching the date numbers in Superset. but what to do if I want only previous dates. i.e.
5
6
7
8
9
10
15
16
17
18
19
20
only negative tolerance.

採用された回答

Titus Edelhofer
Titus Edelhofer 2016 年 2 月 16 日
Hi,
use
which datefind
to find the file datefind.m in the finance toolbox. Copy it to your folder and name it "mydatefind.m". Open in the editor and replace the line
i = find(d <= tol);
by
i = find(d <= tol & super<=sub(idx));
Hope this helps,
Titus

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFinancial Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by