how to use datefind function?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
pruth
am 16 Feb. 2016
Beantwortet: Titus Edelhofer
am 16 Feb. 2016
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 Kommentare
Akzeptierte Antwort
Titus Edelhofer
am 16 Feb. 2016
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Financial Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!