how to extract previous week and month number of same hour?
古いコメントを表示
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 件のコメント
KSSV
2020 年 6 月 16 日
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
2020 年 6 月 16 日
KALYAN ACHARJYA
2020 年 6 月 16 日
You can do it in multiple ways, it would be better to clear, if you can attach one same file
MUKESH KUMAR
2020 年 6 月 16 日
Steven Lord
2020 年 6 月 17 日
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)
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!