Starting point:
  • 'n' different data sets, with different start dates, but with the same end day (today)
  • all 'n' tables have a column 'Date' in datetime, with format yyyyMMdd, and a number of other columns, which are of type 'double', where just one column is of interest to extract. Which can be called X.
The problem is to make a general code:
  1. I want to decide the timerange to extract by taking the shortest dataset, and adjust all other sets down to the same range. something like the following: start_date = max[table1.date(1) table2.date(1)..... table'n'.date(1)]. end_date = table.date(end).
  2. Create a new timetable with range (start_date : end_date). This table should inlude: The dates AND the corresponiding 'X' column from all 'n' tables.

 채택된 답변

Steven Lord
Steven Lord 2021년 3월 25일

0 개 추천

Turn your table arrays into timetable arrays using table2timetable. Once you have a collection of timetable arrays, synchronize them. You'd want to specify that you want to use either the 'intersection' or the 'commonrange' of the times as the new time basis.

댓글 수: 2

Andreas Bull
Andreas Bull 2021년 3월 25일
Would you have a sugguestion to how to write this code ?
Steven Lord
Steven Lord 2021년 3월 25일
Start off by looking at the examples on the table2timetable and synchronize documentation pages. See if you can adapt one or more of those examples to your data. If none of them seem close enough for you to determine how to use them for your data, show us what you've tried and we may be able to suggest minor modifications to your code.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2021년 3월 25일

댓글:

2021년 3월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by