I would like to use the join function to align timestrings, is this possible?
4 views (last 30 days)
Show older comments
I keep getting an error message when I try to combine two 2 column matrices, one of these columns are timestrings and the other various temperatures. The error is
Undefined function 'join' for input arguments of type 'double'.
Error in Untitled (line 7) C = join(A,B)
The timestrings are occuring at a different frequency for the two matrices, does this effect things?
Thank you for your help
2 Comments
Answers (1)
Walter Roberson
on 3 May 2016
As CS Researcher indicates, join is for table object. You could convert your arrays to tables and join() those.
But remember that join is going to look for exact equality in entries, and if your timestamps are numeric there is a possibility that the the last bit or two of two seemingly equal timestamps might not match. If you are using R2014b or later, it would be better to read the data into tables directly using readtable, having it convert the external timestamps into datetime objects.
If you need interpolation between the two tables, that the entries are to be matched by "nearest" timestamp or something like that, then you need a different strategy, involving first deciding on the time stamps desired for the joined data, and then interpolating one or both arrays to the target timestamp and then combining the two.
2 Comments
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!