plot specific time points of everyday in an automated data
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi there
I am working with autmated weight data recorded every 15 minutes ove 14 months. I really need help to plot specific time points for every single day for example I need to plot weight data for every day between 4-6am over the 14 month.
Your help will be highly appreciated
1 Kommentar
Antworten (1)
Duncan Po
am 9 Jun. 2021
See this example of checking the hour component of a datetime, and then using logical indexing to extract a time range:
dt = datetime(2021,1,1):minutes(15):datetime(2021,1,4); % construct a datetime every 15 minutes for 3 days
h = hour(dt);
dt1 = dt(h >= 4 & h < 6); % extract only between 4am and 6am
dt1(1:5)
ans =
1×5 datetime array
01-Jan-2021 04:00:00 01-Jan-2021 04:15:00 01-Jan-2021 04:30:00 01-Jan-2021 04:45:00 01-Jan-2021 05:00:00
1 Kommentar
dpb
am 9 Jun. 2021
Bearbeitet: dpb
am 9 Jun. 2021
Indeed, timerange() does NOT have sufficient intelligence built into it to be able to isolate a time-of-day section; it is a brute-force-only club, it seems.
I think this is a big oversight in functionality; one should NOT have to build secondary grouping/selection variables manually for such tasks.
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!