how to use datefind function?
2 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Financial Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!