Load data from txt file

1 次查看(过去 30 天)
Hi to everyone! My saved output is in a txt file like this:
LECROYWS454,18357,Waveform
Segments,1,SegmentSize,249980
Segment,TrigTime,TimeSinceSegment1
#1,18-Oct-2011 15:28:23,0
Time,Ampl
-0.499955983,0.000559277
-0.499951983,0.000560498
-0.499947983,0.000562451
-0.499943983,0.000563672
...
I want load this data in a matrix with two column (time - amplitude), skipping first 5 lines. How can I do this?

采纳的回答

Walter Roberson
Walter Roberson 2011-10-20
fid = fopen('LECROYWS454.txt','rt');
result = textscan(fid, '%f%f', 'HeaderLines',5, 'Delimiter',',', 'CollectOutput', 1);
fclose(fid);
YourData = result{1};
clear result

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by