Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Missing days in Time Table when calculating means

1 回表示 (過去 30 日間)
Eric Escoto
Eric Escoto 2020 年 9 月 29 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello,
I have a rainfall dataset that produces data only when it rains. Meaning there are breaks in the daily data values. No zeros in days that are missing.
I'm trying to calculate means and notice that my TT doesnt have the full range of the month.
How can I populate the timetable to include these days with zero values so I can compute means?
The datatable is attached.
Thanks!

回答 (1 件)

Star Strider
Star Strider 2020 年 9 月 30 日
It appears to be correct when I look at at it, with complete day series and zeros in the second column, apparently for the missing days, and non-zero entries for the others.
In any event, if you have a data set with missing days, the way to fill them (with ‘TT’ being your original timetable) is:
TTr = retime(TT, 'daily', 'fillwithconstant','Constant',0);
This also creates a second timetable ‘TTr’ so the initial one is preserved.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by