You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Rounds matlab datenum time to a multiple value of a time unit.
Have you ever wanted to grid a dataset on, say, a 15 minute grid, and want the time to start at the nearest 15 minute interval from the top of the hour? This is the script for you!
For time = datenum(2023,11,10,18,23,47), round_datenum(time,'minute',15,'ceil') returns datenum(2023,11,10,18,30,00)
Handles rounding year, month, day in year, hour, minute, and second
Can specify to round to the nearest value, or in a set direction
Only workes for single datenum time inputs
Cite As
Alexander Andriatis (2026). round_datenum (https://www.mathworks.com/matlabcentral/fileexchange/154890-round_datenum), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0 (1.88 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0 |
