how to extract previous week and month number of same hour?
Mostra commenti meno recenti
I had load data of one year, half houly data of load (1*17520), I want to add a column having load data of previous week (same day & time period) and another column having previous day data at same time slot
We can keep blank for initial week/day data because for that previous data is not available here.
5 Commenti
KSSV
il 16 Giu 2020
You split the date availables into days, months, years, hours, minutues, seconds using datevec. You can use indexing of months and time you want and get the value you want.
MUKESH KUMAR
il 16 Giu 2020
KALYAN ACHARJYA
il 16 Giu 2020
You can do it in multiple ways, it would be better to clear, if you can attach one same file
MUKESH KUMAR
il 16 Giu 2020
Steven Lord
il 17 Giu 2020
KSSV: if MUKESH KUMAR has the date and time data stored as a datetime array or as the time vector in a timetable, there's no need to split that data to jump backwards a day or a week.
d = datetime('now')
dMinusWeek = d - calweeks(1)
dMinusDay = d - caldays(1)
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spreadsheets in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!