Reshape daily time series between 1D and calendar-like 3D matrices.
Updated 20 May 2019

View License

This function aids in analysis of multi-year time series by reshaping daily data sets from 1D to 3D or from 3D to 1D. 3D time series coordinates correspond to DAYSxMONTHSxYEARS and will always be 31x12xNUMBEROFYEARS. Missing data values and non-real days (e.g. April 31) are replaced by NaNs.
[s,t] = reshape_daily(s,t)
[s,t,year,month,day] = reshape_daily(s,t)
[s,t] = reshape_daily(s,t) returns reshaped time series arrays corresponding to time t and the signal S. If input arrays are Nx1 or 1xN, 3D arrays s and T are returned. If input arrays are 3D, Nx1 arrays are returned. Time array t must be in datenum format.

[s,t,year,month,day] = reshape_daily(s,t) also returns year, month, and day arrays corresponding to t.

Cite As

Chad Greene (2024). reshape_daily (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: downsample_ts

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Added live scripts

Demo file.

Demo file edits.

Demo file inclusion.