Import Mixed Data from Text Files

조회 수: 18 (최근 30일)
Rohola Hasanpour
Rohola Hasanpour 2017년 8월 28일
편집: ES 2017년 8월 28일
Hi everybody, How I can import such a mixed data from a text file and divide it to 4 columns without comma and parenthesis?
118529 (-2.108770e+06, 3.933470e+05, 2.268206e+05)
118530 (-1.931512e+06, 4.249201e+05, 4.509320e+05)
118531 ( 4.161104e+04,-2.671660e+05, 5.747989e+02)
118532 (-2.590310e+05, 1.361436e+05, 4.507392e+05)
118533 (-2.294893e+06,-5.320514e+04,-8.098187e+05)
118534 (-4.120486e+05,-1.244110e+05, 1.445418e+04)
118535 ( 2.865362e+05,-1.483941e+05, 5.440831e+04)
118536 (-1.341668e+06, 1.425650e+04,-2.907751e+05)

답변 (1개)

ES
ES 2017년 8월 28일
편집: ES 2017년 8월 28일
fid = fopen('mydata.txt');
C = textscan(fid, '%d(%f,%f,%f)');
fclose(fid);

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by