reading data from a file which include symbols.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
anton fernando
am 27 Mai 2015
Kommentiert: anton fernando
am 28 Mai 2015
I need to read the first column of the file attached and the last 3 digits of each line as a column. Appreciate any help.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 27 Mai 2015
t = regexp(fileread('Dst.txt'), '(\r)?\n', 'split');
firstcol = regexp(t, '^\S+', 'match');
last3 = regexp(t, '...$', 'match');
first_last = [firstcol(:), last3(:)];
first_last{1,1}, first_last{1,2} is the pair for the first line
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Import and Analysis 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!