Can I specify the variable name to use as a key when I use innerjoin() or does it have to be a column number?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
T4H14
am 30 Okt. 2017
Bearbeitet: Guillaume
am 30 Okt. 2017
Can I use innerjoin(A,B,'Keys','Date') or do I have to use innerjoin(A,B,'Keys'1) when innerjoining two tables which have a commom first colunn called Date (with datetime variables)? Is there any advantage or disadvantage to doing it one way or the other?
0 Kommentare
Akzeptierte Antwort
Guillaume
am 30 Okt. 2017
Bearbeitet: Guillaume
am 30 Okt. 2017
It's all very well documented. keys can be a positive integer index, a vector of positive integer indices, a character vector of the name of the column, a cell array of character vectors of the names of the column or a logical vector.
It's the same syntax you use to refer to any column of a table, which is all explained in access data in a table.
There may be a negligible speed difference between the methods but nothing worth worrying about. As it's not documented, this could change from version to version. So, use whichever method is more convenient for you.
edit: of course, using numeric or logical indexing means that the key(s) must be the same column index(es) in both tables. With a char array or cell array of char arrays they don't have to be.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!