How to read hh:mm:ss.sss time format from a file that has time and other data

22 ビュー (過去 30 日間)
Nada Elsharkawy
Nada Elsharkawy 2021 年 11 月 24 日
編集済み: Stephen23 2021 年 11 月 24 日
Basically I am working with generated ECG data.
The data is stoed as follows in the file as points
00:00:00.000 -0.060
00:00:00.010 -0.065
00:00:00.020 -0.060
00:00:00.030 -0.075
00:00:00.040 -0.065
00:00:00.050 -0.070
00:00:00.060 -0.070
and so on.
when I load the data from the file Matlab interpets it as this:
0 -0.0600000000000000
0 -0.0650000000000000
0 -0.0600000000000000
0 -0.0750000000000000
0 -0.0650000000000000
0 -0.0700000000000000
0 -0.0700000000000000
0 -0.0900000000000000
how do I fix this, i need the time format to be changed to seconds

回答 (1 件)

Stephen23
Stephen23 2021 年 11 月 24 日
編集済み: Stephen23 2021 年 11 月 24 日
Because you did not upload a sample file I had to create my own (attached).
T = readtable('test.txt')
T = 7×2 table
Var1 Var2 ____________ ______ 00:00:00.000 -0.06 00:00:00.010 -0.065 00:00:00.020 -0.06 00:00:00.030 -0.075 00:00:00.040 -0.065 00:00:00.050 -0.07 00:00:00.060 -0.07
T.Var1
ans = 7×1 duration array
00:00:00.000 00:00:00.010 00:00:00.020 00:00:00.030 00:00:00.040 00:00:00.050 00:00:00.060

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by