Find the data same week day one year ago.

4 views (last 30 days)
Hi friends.
I have electricity demand data every 24 hours for every day of several years ago. I need to obtain for each data of the same day of the week of the previous year. That is, if I have the data of Monday, December 2, 2019 at 5:00 p.m., I would like to have the data of Monday, December 3, 2018 at 5:00 p.m., which corresponds to the first Monday of the month of December , and like that for all data.
I have seen that with Financial Toolbox there are some useful tools, but I do not have that tool. thanks for your help
my data is:
fecha hora hora2 MW_Demanda Real
mar 1/04/08 0:01 1:00 678.5
mar 1/04/08 1:01 2:00 669.1
mar 1/04/08 2:01 3:00 668.2
mar 1/04/08 3:01 4:00 670.1
mar 1/04/08 4:01 5:00 765.8
mar 1/04/08 5:01 6:00 867.5
mar 1/04/08 6:01 7:00 898.6
mar 1/04/08 7:01 8:00 932.6
mar 1/04/08 8:01 9:00 1007.9

Accepted Answer

Steven Lord
Steven Lord on 2 Dec 2019
You want the date exactly 52 calendar weeks ago?
datetime('today')-calweeks(52)
  1 Comment
Juan Carlos Pozuelos Buezo
Thanks Steven, yes! i need the data for the same week day and hour one year ago.

Sign in to comment.

More Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!