How can I extract the time column of a timetable
106 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I need to extrct the time column of a timetable as I need to manipulate it.
any Ideas?
3 件のコメント
Peter Perkins
2019 年 5 月 3 日
Just for the record, David was correct, except for one subtle point: the row times in a timetable are metadata, not one of the variables. You can access them by name in exactly the same way, though.
David created his timetable with a workspace variable named MeasurementTime, whose name the timetable picked up; that's why his row times were named Measurement time. The default name is Time, though.
採用された回答
Andrei Bobrov
2019 年 4 月 20 日
編集済み: Andrei Bobrov
2019 年 4 月 20 日
variant
a = rand(20,6);
date1 = datetime(2019,4,19) + hours(cumsum(70*rand(20,1)));
TT = array2timetable(a,'RowTimes',date1);
date_out = TT.Time;
2 件のコメント
その他の回答 (1 件)
Haris K.
2020 年 5 月 13 日
You can also use directly:
TT = timetable(Temp,Pressure,WindSpeed,WindDirection, 'RowTimes',MeasurementTime)
datetime_vec = TT.Time
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Timetables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!