creating a look up table to compare datetime stamps
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dharmesh Joshi
am 20 Nov. 2022
Kommentiert: Dharmesh Joshi
am 24 Nov. 2022
Hi
I need to create a look up table, where i would need to specify. This will need to a manual table, where i would need to spicify the following:
Start DateTimeStamp, Stop DateTimeStamp and Device ID.
Then i would like to compare a incoming datastreams timestamp, aganist this lookup table to to NaN samples between the dates.
How can i create a table from Matlab, instead of using spreadsheet and how do you compare timestamps?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 20 Nov. 2022
DateTime = datetime('now')+hours(0:4:150).';
DeviceID = randi(9, size(DateTime));
T1 = table(DateTime,DeviceID)
Start_DateTimeStamp = "21-Nov-2022 12:00";
Stop_DateTimeStamp = "22-Nov-2022 18:00";
Device_ID = randi(9)
Lv = isbetween(T1.DateTime, Start_DateTimeStamp, Stop_DateTimeStamp) & Device_ID==T1.DeviceID;
Query = nnz(Lv)
Result = T1(Lv,:)
Make appropriate changes to work with your data.
.
10 Kommentare
dpb
am 23 Nov. 2022
Nothing prevents you from organizing the file structure however it best suits the task...
Again, you've given us absolutely no context with which to work; how are we to have any idea of any specific organization or code structure that would fit?
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!