- Create proper timetables for all variables (use datetime format)
- resample using retime to get the same time-slots (optional)
- synchronize time-series
Merging tables of dissimilar rows in MATLAB.
1 次查看(过去 30 天)
显示 更早的评论
My program runs in parallel using parfeval to generate two tables of data. one from a sensor and the other from a robot (UR5). I want to merge these two tables together. The common column is the Time, although there are little differences in their times as they run at different speeds and that makes the rows unequal too. But I want a table containing all the other variables from rows which times are equal or very close. So at the end, there will be only one column for Time. Find photos of sample results attached. Can I get a help?
0 个评论
采纳的回答
jonas
2018-8-27
编辑:jonas
2018-8-27
You can do the following steps:
If I remember correctly, synchronize will pad the shorter arrays with NaN's.
Please provide actual data (not images) if you need help with the code.
9 个评论
jonas
2018-8-27
编辑:jonas
2018-8-27
@Sean de Wolski: Thanks, that works!
@DEYIRE: That's easy. Just write your desired names in a cell array like this:
TT.Properties.VariableNames={'A','B','C','D','E','F','G','H','I','J'}
The cell array must have the same number of cells as the number of table columns (excluding the column with time), and you can only use names that also function as variables, i.e. A-Z and underscore _.
Please copy and paste the code from the previous comment one more time to your script. I made a small but important change.
Finally, please accept if the answer was helpful :)
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Timetables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!