Filter löschen
Filter löschen

Compare/find datevector und timevector

1 Ansicht (letzte 30 Tage)
Timur
Timur am 24 Jul. 2023
Kommentiert: Timur am 25 Jul. 2023
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.

Akzeptierte Antwort

Raheel Naveed
Raheel Naveed am 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

Weitere Antworten (0)

Kategorien

Mehr zu Time Series Objects finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by