dear advisers,
i have multiple timetables with different timestamps (yyyy-mm-dd hh:mm), but within a same time period.
I wish to merge multiple timetables into a single timetable, and the measurement recorded for each corresponding timestamps shall be organized in ascending order (e.g. 2020-08-01 0:00 , 2008-08-01 1:00, ....).
Thank you for your advice.

 채택된 답변

Cris LaPierre
Cris LaPierre 2020년 8월 23일

1 개 추천

You might be able to use synchronize. If you have more than 2 tables, you will need to use it multiple times.

댓글 수: 2

J. Alex Lee
J. Alex Lee 2020년 8월 23일
Just a quick note this would probably require conversion of your tables into timetables first with table2timetable().
Also based on quick read of the docs, doesn't appear to have an option to behave more like a join, i.e., do not fill missing? Anyway I suppose it ultimately depends on exactly what the end objective is.
Cris LaPierre
Cris LaPierre 2020년 8월 23일
The OP states they are using timetables.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

J. Alex Lee
J. Alex Lee 2020년 8월 21일
편집: J. Alex Lee 2020년 8월 21일

1 개 추천

If the tables have the same columns, you should be able to simply vertically concatenate them and sort
t0 = sortrows(vertcat(t1,t2,t3))

댓글 수: 4

Sehoon Chang
Sehoon Chang 2020년 8월 21일
thanks for the answer Alex.
Unfortunately, they do not have same columns. some data have different measurement interval.
do you have other suggestion that i could use?
cheers
J. Alex Lee
J. Alex Lee 2020년 8월 21일
i don't understand what measurement interval (diff(timestamp)?) has to do with number of columns in the table?
when you say "Table" are you referrring to the matlab "table" data type, or are you using it generically to mean "some 1D or 2D list of things"?
you can get better answers if you are more specific, e.g., post the actual data or some approximation of it.
Sehoon Chang
Sehoon Chang 2020년 8월 22일
yes, i meant the matlab 'table'.
What i meant by the measurement invertal (diff(timestamp)) is...
table_1 lists radiation value every 15 minutes and table_2 lists other measurements every hour.
Thanks alot for your help :)
J. Alex Lee
J. Alex Lee 2020년 8월 22일
look into "innerjoin" and "outerjoin"

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

질문:

2020년 8월 21일

댓글:

2020년 8월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by