import data without header
12 ビュー (過去 30 日間)
古いコメントを表示
I need to import data from a .TXT file.
Skip header
Data in different variables (Ex: time, Ch1, Ch2 and Ch3)
I can't do it, does anyone have any examples?
DynoWare Version 2.6.3.12
Path: C:\Users\FT10R0\
Filename: FT10R0.dwd
Config ID: FT10R0.cfg
Setup ID: 0
Manipulated: 0
Filename 1:
Filename 2:
Date: quinta-feira, 24 de outubro de 2019
Time: 10:22:19
Sampling rate [Hz]: 16383
Measuring time [s]: 360
Delay time [s]: 0
Cycle time [s]: 0
Cycles: 1
Samples per channel: 5897881
Cycle interval: 0
Cycle No: 1
Time Ch1 Ch2 Ch3
s N N N
0,000000 0,0450134 0,0473022 0,0534058
0,000061 0,0465393 0,0442505 0,0564575
0,000122 0,0442505 0,0457764 0,0549316
0,000183 0,0434875 0,0465393 0,0541687
0,000244 0,0442505 0,0465393 0,0572205
0,000305 0,0465393 0,0465393 0,0549316
0,000366 0,0434875 0,0473022 0,0556946
0,000427 0,0457764 0,0457764 0,0549316
0,000488 0,0442505 0,0457764 0,0564575
0 件のコメント
採用された回答
Stephen23
2019 年 11 月 5 日
編集済み: Stephen23
2019 年 11 月 5 日
opt = {'HeaderLines',20};
fmt = repmat('%f',1,4);
str = fileread('temp0.txt');
C = textscan(strrep(str,',','.'),fmt,opt{:});
time = C{1};
Ch1 = C{2};
Ch2 = C{3};
Ch3 = C{4};
Giving:
>> [time,Ch1,Ch2,Ch3]
ans =
0 0.045013 0.047302 0.053406
6.1e-05 0.046539 0.04425 0.056458
0.000122 0.04425 0.045776 0.054932
0.000183 0.043487 0.046539 0.054169
0.000244 0.04425 0.046539 0.057221
0.000305 0.046539 0.046539 0.054932
0.000366 0.043487 0.047302 0.055695
0.000427 0.045776 0.045776 0.054932
0.000488 0.04425 0.045776 0.056458
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Import and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!