Clear Filters
Clear Filters

Compare/find datevector und timevector

1 view (last 30 days)
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.

Accepted Answer

Raheel Naveed
Raheel Naveed on 24 Jul 2023
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

More Answers (0)

Tags

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!