Can you temporarily remove a column from timetable?

3 ビュー (過去 30 日間)
ZH
ZH 2020 年 7 月 17 日
コメント済み: Walter Roberson 2020 年 7 月 20 日
I have a time table and want to remove a column that marks true or false, so it can be retimed (retime does not work if there are characters), then add it back once retime is finished.
  13 件のコメント
ZH
ZH 2020 年 7 月 20 日
Correct
Walter Roberson
Walter Roberson 2020 年 7 月 20 日
Suppose the entry at 6.8 has the flag false, and the entry at 7.2 has the flag true, then when retime tries to create the entry for 7.0 should the flag be set to false or to true or to round(interp1([6.8 7.2], [0 1], 7.0)) ?

サインインしてコメントする。

回答 (1 件)

Steven Lord
Steven Lord 2020 年 7 月 18 日
Selecting only variables of a certain type is easy if you index into the timetable using a vartype. Adding the variables that you didn't retime back into the timetable is likely to be trickier.
dt = datetime('now')+minutes([0; 5]);
T = timetable(dt, [0; 5], [true; false])
V = vartype('double');
R = retime(T(:, V), 'minutely', 'linear')
What should be the values for Var2 in each row of R? If it should be a logical variable, where should the transition from true to false take place? If it should be a double variable, why not just cast it to double in T using double before calling retime?

カテゴリ

Help Center および File ExchangeTables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by