필터 지우기
필터 지우기

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

조회 수: 98 (최근 30일)
Ano
Ano 2016년 11월 25일
댓글: unme 2017년 2월 9일
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

채택된 답변

KSSV
KSSV 2016년 11월 25일
편집: KSSV 2016년 11월 25일
doc textscan
fid = fopen('your text file') ;
data = textscan(fid,'%f %f %f','HeaderLines',7) ;
data = cell2mat(data)
fclose(fid);
  댓글 수: 3
KSSV
KSSV 2016년 11월 25일
Yes you are right...
unme
unme 2017년 2월 9일
Probably its a impedance matrix from the Feko??

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by