Compare/find datevector und timevector

1 次查看(过去 30 天)
Hello to all,
please can you show me right way. I must update one table from another. as point i have timestamp. step is 10 min.
at the first from this format i make vector with "datevec" because {'20-Jul-2023 14:10:47'} default format. then i stack
i must find vector from second table witch not loger as 10 min. but ist hard
i am on the right way or i can use samthing else and simple.
thanks a lot for your answers.

采纳的回答

Raheel Naveed
Raheel Naveed 2023-7-24
Hi,
You mentioned using datevec, which converts date strings to date vectors. However, to perform operations based on timestamps, I recommend you convert your dates into datetime objects.
table1.timestamp = datetime(table1.timestamp,'InputFormat','dd-MMM-yyyy HH:mm:ss'); % Assuming table1 as your first table
Let's assume table1 and table2 are your two tables and they both have a variable timestamp of datetime type.
mergedTable = innerjoin(table1, table2, 'Keys', 'timestamp');
The innerjoin function merges rows from two tables based on key variables (in this case, timestamp).
Thanks

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by