Join two tables MATLAB
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello everyone, I have two tables with different headers (mostly) and have 2-3 headers in common. I want to use one header which is the time column(not in datetime format). to join the two tables. My problem is that there are few places where both tables have values for the same time insatnce and then there are places where they dont have any values corresponding to each other time instances. Can any one suggest how can I make them as one table with showing all the variables from Table 1 and Table 2 as well shwing the data for common time stamp and filling the rest data in where they dont match each other time stamp with NaN's.
I tried using join but it keeps telling me that I have to have unique data points I also tried union but that will require me to have same headers and I did add same headers by introducing NaN data under the new column headers(introduced in both the tables) but then again as I said earlier that for few time stamp which is common to both I have data I am missing those as I am adding NaN to the whole set to match the length of each table.
Can any one suggest me wat approach I could use.
Also as a note I cant convert my time column to datetime as it has a wired formating.
Please, let me know wat your suggestion are.
댓글 수: 0
채택된 답변
Peter Perkins
2019년 2월 21일
Isn't outerjoin what you are looking for? It will give you one table with rows that match, rows that are only in the left, and rows that are only in the right.
Also, your times would have to have very weird formatting indeed to not be convertable to datetime. What do you have exactly?
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!