Hello everybody,
I have some irreuglar spaced measurements of water discharge and battery voltage. I managed to convert the values into a regular spaced timetable with hourly entries, filled with zeroes where no values exist like this:
y20_z1h =
508×3 timetable
dt Nr Qty VBatt
___________________ ___ ___ _____
2020-09-25 10:00:00 1 0 3.21
2020-09-25 11:00:00 0 0 0
2020-09-25 12:00:00 2 1 3.49
2020-09-25 13:00:00 0 0 0
2020-09-25 14:00:00 0 0 0
2020-09-25 15:00:00 0 0 0
2020-09-25 16:00:00 0 0 0
2020-09-25 17:00:00 0 0 0
2020-09-25 18:00:00 0 0 0
2020-09-25 19:00:00 3 1 3.5
2020-09-25 20:00:00 0 0 0
…
Now I'd like to scale the timetable to exactly one year from '2020-01-01 00:00:00' to '2020-12-31 23:00:00' and also fill the missing values with zeros.
I already tried retime() with
oneyear = retime(y20_z1,'hourly','fillwithconstant', 'Constant',0);
where oneyear is an hourly timetable filled with zeroes like in: https://de.mathworks.com/help/matlab/ref/timetable.retime.html#d122e1135381 but neither this, nor applications with timerange() did the job.
Do you have any idea how to solve this?
Thanks so much in advance!
Best Answer