How to merge two timetables with different data and time?
12 ビュー (過去 30 日間)
古いコメントを表示
Wolfgang McCormack
2021 年 1 月 18 日
コメント済み: Wolfgang McCormack
2021 年 3 月 12 日
Hi everyone, I had a nice and clean time table that I had to extract some sections of it for calculations during different hours of day. For example Jan to May 10 to 14 and 0 to 10 and 14 to 00. Now I have three time tables from the extracted one. I want to merge them again so that I will have one clean timetable with only one column of data rather than 3 columns with NaN (that what I am getting). Also, [T1;T2] is not working and retrns the following error:
All tables in the bracketed expression must have the same number of rows.
5 件のコメント
採用された回答
Adam Danz
2021 年 3 月 10 日
> [T1;T2] is not working and retrns the following error: All tables in the bracketed expression must have the same number of rows.
This is fishy. The example below shows that a vertical concatenation is perfectly fine when the tables have a different number of rows.
Please share
- the result of head(T) for each table
- the line of code where you're doing the concatenation
- the entire error message.
Demo:
T1 = array2timetable((1:3)'.*ones(1,4), 'RowTimes', datetime('today')+(0:2))
T2 = array2timetable((1:5)'.*ones(1,4), 'RowTimes', datetime('today')+(0:4))
T = [T1; T2]
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!