Find overlapping days across two datetime variables
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Farbod Tabaei
am 27 Jul. 2022
Kommentiert: Farbod Tabaei
am 27 Jul. 2022
Hey there,
I have two datetime variables "Hot_days (520x1)" and "Drought_days (1974x1)" that lists days since 2009 which experienced hot and dry conditions respectively. Now I would like to find the days that experiened BOTH dry and hot conditions. In other words, I would like to find the days that overlap with each other across the two different datetime variables.
Thank you in advance!
0 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 27 Jul. 2022
%random data
dt1=datetime(2022,6,1):datetime(2022,7,27); %1st June to Today
dt2=datetime(2022,7,1):datetime(2022,9,1); %1st July to 1st September
intersect(dt1,dt2)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB 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!