Is it possible to use outerjoin for more than two tables?

4 ビュー (過去 30 日間)
Stefan Azzopardi
Stefan Azzopardi 2018 年 6 月 14 日
コメント済み: Peter Perkins 2018 年 7 月 3 日
Is it possible to use the function 'outerjoin' in Matlab for more than 2 tables? Basically, I have a number of variables (around 15), all in table (1x2) having one column timestamp and another column variable. I am trying to join all variables in one table to finally make some calculations. The method of outerjoin worked perfectly for the first 2 tables but could not add more than 2 variables.
If this is not possible, is there an alternative way on how should I proceed?
Regards
  5 件のコメント
Stefan Azzopardi
Stefan Azzopardi 2018 年 6 月 17 日
I have tried the loop but it gives error, which I managed to fix. Still the names of the columns end up to be renamed by Matlab so that one still can verify the name. Also, I have around 15 tables to join and therefore this would take an infinintely big loop and therefore I was asking whether there was an alternative way in which one could perform this operation.
Peter Perkins
Peter Perkins 2018 年 7 月 3 日
It's kind of impossible to tell from your description, but it may be that you want to merge the keys, which is not the default in an outerjoin.
I would think that the bigger problem would be that doing an outerjoin on 15 tables would give you a very large number of rows, unless there are few if any non-matches, in which case you might consider an innerjoin.

サインインしてコメントする。

採用された回答

Stefan Azzopardi
Stefan Azzopardi 2018 年 6 月 14 日
Am still finding problems trying this way:
s = outerjoin (Timestamp, J_Incoming)
s.Timestamp_J_Incoming = []
d = outerjoin (s, CP_Incoming)
in this section it is giving me error on variable 'd'. Timestamp is 1 column of time, J_Incoming and CP_Incoming contains 2 columns each, 1 Variable and 1 Timestamp. Using 's', I have created a table with 1 Timestamp and 1 Variable (J) after clearing on of the J_Timestamp. It is still giving me error "Cannot find a common table variable to use as a key variable." The variable on CP_ Incoming is timestamp

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by