skip the headers in a text file and extract the data ?

136 Ansichten (letzte 30 Tage)
Ano
Ano am 25 Nov. 2016
Kommentiert: unme am 9 Feb. 2017
I would like to extract the data only from a text file. the text file has a header which contains some numerical values as shown below?
Matrix detected
Double precision storage used.
Matrix size is 5 x 5
Matrix elements a(m,n)
m: matrix row
n: matrix column
m n value
1 1 -4.741986825761376E+00
2 1 -4.630424392475458E+00
3 1 -4.307409743346405E+00
4 1 -3.804889997051831E+00
5 1 -3.171836516325863E+00
1 2 -4.630424380271435E+00
2 2 -4.741959894978010E+00
3 2 -4.630411248725576E+00
4 2 -4.307409755549543E+00
5 2 -3.804868350860215E+00
1 3 -4.307409755549557E+00
2 3 -4.630411248725565E+00
3 3 -4.741959894978017E+00
4 3 -4.630424380271435E+00
5 3 -4.307397514355404E+00
1 4 -3.804889997051820E+00
2 4 -4.307409743346408E+00
3 4 -4.630424392476307E+00
4 4 -4.741986825762240E+00
5 4 -4.630424392476300E+00
1 5 -3.171836516321907E+00
2 5 -3.804868350853141E+00
3 5 -4.307397514355404E+00
4 5 -4.630424380271435E+00
5 5 -4.741959894978017E+00

Akzeptierte Antwort

KSSV
KSSV am 25 Nov. 2016
Bearbeitet: KSSV am 25 Nov. 2016
doc textscan
fid = fopen('your text file') ;
data = textscan(fid,'%f %f %f','HeaderLines',7) ;
data = cell2mat(data)
fclose(fid);
  3 Kommentare
KSSV
KSSV am 25 Nov. 2016
Yes you are right...
unme
unme am 9 Feb. 2017
Probably its a impedance matrix from the Feko??

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Export finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by