Azzera filtri
Azzera filtri

Load data from txt file

1 visualizzazione (ultimi 30 giorni)
Pietro Rossi
Pietro Rossi il 20 Ott 2011
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?

Risposta accettata

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

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by