Create duration array template
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Luis Eduardo Cofré Lizama
am 29 Jul. 2022
Kommentiert: Luis Eduardo Cofré Lizama
am 29 Jul. 2022
I need to create a duration array as below. However, instead of getting tx with a length of 720000, Im getting 7200000001?
The context is that I will create this array as a timestamp template to then match my recorded times (and corrsponding data) with the closest time in this template.
ti = duration('00:00:0.00','Format','hh:mm:ss.SSS');
tf = duration('02:00:0.00','Format','hh:mm:ss.SSS');
interval = milliseconds(0.010);
tx = ti:interval:tf;
Cheers
0 Kommentare
Akzeptierte Antwort
Chunru
am 29 Jul. 2022
ti = duration('00:00:0.00','Format','hh:mm:ss.SSS');
tf = duration('02:00:0.00','Format','hh:mm:ss.SSS');
interval = milliseconds(0.010);
% number of points
n = 2*3600/(0.01e-3)+1
% to make 720000 points
interval = seconds(0.010);
tx = ti:interval:tf;
whos
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!